Hello, Check the result of
> min(c(1,2,3,4,NA,6)) And read > ?min Hope this helps, Pascal 2013/8/31 Casey Zhang <casey1...@gmail.com> > Hi, > > I'm just starting to learn how to use R and I'm trying to create a > histogram with 7 breaks. This is my code so far: > > dat=read.table("titanic.csv",header=TRUE,sep=",",na.string=".") > age=dat$Age > breaks=seq(min(age),max(age),length=7) > hist(age,breaks,freq=FALSE) > > I don't know why, but on the fourth line it always gives this error: > > Error in if (from == to) rep.int(from, length.out) else as.vector(c(from, > : > missing value where TRUE/FALSE needed > > What am I doing wrong? I know the data itself does have a lot of NA > values for age, would this be the problem? > > > Thanks, > > CZ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.