Re: [R] Subset and plot

2010-02-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.02.2010 02:54:46: > Let's look at your data frame: > > > str(daily.sub1) > 'data.frame': 9 obs. of 4 variables: > $ Trial: Factor w/ 1 level "2": 1 1 1 1 1 1 1 1 1 > $ Tanks: Factor w/ 3 levels "a4","c4","h4": 1 1 1 2 2 2 3 3 3 > $ Day : Facto

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
Don't need to convert the factors to numeric as that will happen automatically. See below. However as Rolf pointed out they will be numbered from 1-4 even though only 3 are left in the subset as all 4 levels are maintained. So the snippet below will work as long as you specify 4 possible pch

Re: [R] Subset and plot

2010-02-02 Thread Dennis Murphy
Let's look at your data frame: > str(daily.sub1) 'data.frame': 9 obs. of 4 variables: $ Trial: Factor w/ 1 level "2": 1 1 1 1 1 1 1 1 1 $ Tanks: Factor w/ 3 levels "a4","c4","h4": 1 1 1 2 2 2 3 3 3 $ Day : Factor w/ 9 levels "10","11","12",..: 4 5 6 7 8 9 1 2 3 $ Wgt : Factor w/ 9 levels

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
Initial email: Here is a runable program. When I plot Day and Wgt, it graphs all the data points. All I need is daily.sub1 plotted. I also need each "Tanks" to have its own col or pch. When I run it with the line with pch, it gives me nothing. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep

Re: [R] Subset and plot

2010-02-02 Thread Rolf Turner
What did you ***expect*** or hope to get out of ``c(2,19,21)[Tanks]'' Please note that this expression makes no sense at all as it stands. You apparently want to use plotting symbols 2, 19, and 21 respectively, depending in some way upon the value in ``Tanks''. Since you have sp

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
I tried the following and still could not get it to work. I understand your logic, but cannot get this to work. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep(c("a3","a4","c4","h4"),each=3,2) Day=rep(c(1:12),2) Wgt=c(1:24) daily<-cbind(Trial, Tanks, Day, Wgt) daily daily.sub<-subset(daily, su

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
The problem is with attach. You should have seen an error that the objects are aliased. You have Tanks in your workspace and in the attached dataframe. It is using the one in your workspace which is not a factor variable. Try: c(2,19,21)[Tanks] with(daily.sub1,c(2,19,21)[Tanks]) Avoid att

Re: [R] Subset and plot

2010-02-02 Thread Chuck Cleland
On 2/2/2010 2:51 PM, Marlin Keith Cox wrote: > Here is a runable program. When I plot Day and Wgt, it graphs all the data > points. All I need is daily.sub1 plotted. I also need each "Tanks" to have > its own col or pch. When I run it with the line with pch, it gives me > nothing. DF <- data.f

[R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
Here is a runable program. When I plot Day and Wgt, it graphs all the data points. All I need is daily.sub1 plotted. I also need each "Tanks" to have its own col or pch. When I run it with the line with pch, it gives me nothing. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep(c("a3","a4","c

[R] subset and plot

2008-04-21 Thread Marlin Keith Cox
create a subset for "brook_dis". When I plot (week, R) I get a nice boxplot, but along the x axis, there are weeks a, b, c along with h and nh. Thank you ahead of time. keith rm(list=ls()) cond.exp1<-read.csv("condition/test.csv",header=TRUE) sub<-subset(cond.exp1, Species=="brook_d