on-internet
← Community

How to write summarySE function in R

Stack Overflow ·

I'm a new R user and want to make a line chart with std using ggplot. For this I am using the summarySE function. vrn1_summary<-summarySE(data,measurevar = "vrn1",groupvars = c("genotype","treatment","time")) Since I cannot make my own function, I copied from the R Cookbook as follows: summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE, conf.interval=.95, .drop=TRUE) { library(plyr) # New version of length which can handle NA's: if na.rm==T, don't count them length2 <- function (x, na.rm=FALSE) { if (na.rm) sum(!is.na(x)) else length(x) } # This does the summary. For each

Comments

Sign in or sign up to comment and upvote.

No comments yet.