Skip to content

problems when columns identified in a loop #44

@oscci

Description

@oscci

I've got a script that works fine with individual pirate plots. I want to do 3 pirateplots side by side, so I am specifying the column name for x variable as mycol[i].
This works fine with a beanplot. It also works if there's just one pirateplot.
Using the loop with pirateplot, though, I get the error message
Error in var(y) : 'x' is NULL

Here is the script - I think it's the initial command to select data that throws it, rather than the use of i index in later bits of script.

for (i in 1:3){
pirateplot(all.data[,mycol[i]]~ all.data$randomtwininclude,
point.o = .5,
bar.f.o=.0,
inf.f.o=.2,
bean.b.o=.5,
jitter=.1,
ylab=mypheno[i],
ylim=c(myylim[i,1],myylim[i,2]),
main=paste0(mypheno[i]),
data=all.data
)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions