Re: [R] Basic Error I'm sure

2013-08-30 Thread Pascal Oettli
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 > 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

Re: [R] Basic Error I'm sure

2013-08-30 Thread Ista Zahn
Hi Casey, Yes, if there are missing values than you don't strictly speaking know what the minimum value is. You need to tell min() and max() to exclude missing, i.e., breaks=seq(min(age, na.rm=TRUE),max(age, na.rm=TRUE),length=7) Best, Ista On Fri, Aug 30, 2013 at 9:41 PM, Casey Zhang wrote: >

[R] Basic Error I'm sure

2013-08-30 Thread Casey Zhang
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 four