Using tapply when you have different n for each treatment
Using tapply when you have different n for each treatment I am an R beginner trying to fit my data to a non-linear regression. Specifically I want to fit the rate of insect development over different temperatures to a power function. Below is my code, modified from the examples at the bottom of this page: https://docs.tibco.com/pub/enterprise-runtime-for-R/3.1.0/doc/html/Language_Reference/stats/selfStart.html You should be able to paste the code below right into R to get what I get. structure(list(Larvae_temp = c(10L, 10L, 10L, 10L, 10L, 10L), Larvae_rate = c(0.047757234, 0.04174518, 0.04174518, 0.04174518, 0.04174518, 0.04174518)), .Names = c("Larvae_temp", "Larvae_rate"), row.names = c(NA, 6L), class = "data.frame") SSpower<-(selfStart(~A*(Larvae_temp^B), initial=function(mCall,data,LHS) {xy<-sortedXyData(mCall[["Larvae_temp"]],mCall[["Larvae_rate"]],LarvaeDevelopment) ##I think the error...