search for: sumdf

Displaying 3 results from an estimated 3 matches for "sumdf".

Did you mean: numdf
2005 Feb 03
1
Efficient selection and alteration of dataframe records
...p=c("Sp1","Sp2","Sp3","Sp4","Sp5"), width=runif(5), abun=abun.table$Freq) traitdf[1,] rm(abun.table) #3. merge plotdf and traitdf plotdft=merge(plotdf, traitdf, by.x ="pspp", by.y="tspp") #4 define summary dataframe sumdf sumdf=data.frame(s.n=NA, s.S=NA, s.crop=NA) #reset all data to raw data. #b. calculate crop in plotdft with all species present plotdft$crop=plotdft$width*exp(-2.0+2.42*(log(plotdft$dim))) #c. sum crop sumcrop=sum(plotdft$crop) #d. write n, S, crop to sumdf sumdflength=...
2007 Oct 17
1
passing arguments to functions within functions
...c ("e","f")) df$resp1=rnorm(length(df$fac1)) df # define a funciton to compute mean, std error and n. meanstderr <- function(x) c(Mean=mean(x,na.rm=TRUE),se=sqrt(var (x,na.rm=TRUE)/length(na.omit(x))), n=length(na.omit(x))) # what I want to wrap into a single funtction: sumdf=with(df, summarize(X=resp1, by=llist(fac1, fac2, fac3), stat.name="resp1", FUN=meanstderr)) xYplot(Cbind(resp1, resp1-se, resp1+se) ~ as.numeric(fac1)|fac2, groups=fac3, data=sumdf, type='b', scales=list(x=list(labels=levels(df$fac1), at=1:length(levels(df $fac1)))), xlim=c(0...
2011 Apr 15
1
how to add two data.frame with the same column but different row numbers
Hi all, Suppose I have 2 data.frame , a and b, how can I add them together to get c? Thanks > a A a 1 b 2 c 3 > b A a 6 c 1 > c A a 7 b 2 c 4 -- Best, Zhenjiang [[alternative HTML version deleted]]