[R] plot in package psych with function error.bars.by

Tham Tran hanhtham.tran at yahoo.com.vn
Tue Jun 3 08:28:19 CEST 2014


Hi, 

I have a problem with the function "error.bars.by" in package "psych".
This is the code for example of a graph:

keys.list=list(Agree=c(-1,2:5),Conscientious=c(6:8,-9,-10),Extraversion=c(-11,-12,13:15),Neuroticism=c(16:20),Openness
= c(21,-22,23,24,-25))
keys = make.keys(28,keys.list,item.labels=colnames(bfi))
scores = score.items(keys,bfi,min=1,max=6)
require(psych)
error.bars.by(scores$scores,round(bfi$age/10)*10,by.var=TRUE,
main="BFI age trends",legend=3,labels=colnames(scores$scores),
xlab="Age",ylab="Mean item score")

I need to change the plotting character and line type of the graph according
to the scores (Agree,Conscientious,Extraticism,Openness).

I have tried with: 
error.bars.by(scores$scores,round(bfi$age/10)*10,by.var=TRUE,
main="BFI age trends",legend=3,labels=colnames(scores$scores),
pch=c(1,2,3,4), lty=1
,xlab="Age",ylab="Mean item score")

But there is a problem: 
Error in localWindow(xlim, ylim, log, asp, ...) :  formal argument "pch"
matched by multiple actual arguments

Anyone can help me for this problem. 
Many thanks.

Tham Tran



--
View this message in context: http://r.789695.n4.nabble.com/plot-in-package-psych-with-function-error-bars-by-tp4691632.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list