[R] How to calculate min of a dataset that contains empty column

Chris Li chrisli at austwaterenv.com.au
Wed Sep 16 01:24:49 CEST 2009


Hi all,

I have got a dataset like the following:

a  b  c
1      5
2
3      7

I am taking the minimum of each column and use it as the minimum of the
y-axis of my graphs. My scripts (simplified version) are like the following:

f<-array
f[1]=a
f[2]=b
f[3]=c
for i in 1:3
name=f[i]
ymin<-min(dataset$f[i])
plot(x,y,ylim=c(ymin,100))

The script stops at b, because the min function returns inf value. What can
I do to overcome it?

Many thanks,
Chris
-- 
View this message in context: http://www.nabble.com/How-to-calculate-min-of-a-dataset-that-contains-empty-column-tp25463449p25463449.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list