Displaying 2 results from an estimated 2 matches for "boxtran".
2008 Jun 05
1
choosing an appropriate linear model
...predict(leach.lm)~leachdata$leachate,main="predicted vs. observed
leaching amount",xlim=c(0,12),ylim=c(0,12),xlab="observed
leaching",ylab="predicted leaching")
abline(a=0,b=1)
plot(leach.lm)
dev.off()
library(MASS)
boxcox(leach.lm,plotit=T,lambda=seq(0,0.4,by=0.01))
boxtran <- function(y,lambda,inverse=F){
if(inverse)
return((lambda*y+1)^(1/lambda))
else
return((y^lambda-1)/lambda)
}
png("boxcox-dianostics.png",height=1200,width=700)
par(mfrow=c(3,2))
logleach.lm <- lm(boxtran(leachate,0.21)~rainmm-1,data=leachdata)
plot(leachate~rainmm,da...
2008 Jun 06
6
Subsetting to unique values
I want to take the first row of each unique ID value from a data frame.
For instance
> ddTable <-
data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry"))
I want a dataset that is
Id Name
1 Paul
2 Bob
> unique(ddTable)
Will give me all 4 rows, and
> unique(ddTable$Id)
Will give me c(1,2), but not accompanied by the name column.