[R] Beginner's query - segmentation fault

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Oct 7 15:05:14 CEST 2003


Adaikalavan RAMASAMY wrote:
> I cannot explain the segmentation fault but try this instead (which
> works for matrices) 
> 
> temp[which(temp==-999, arr.ind=T)] <- NA

No! Please *do* use is.na()<- !!!

Uwe Ligges

> Are you sure temp is matrix and not a dataframe ? Use class(temp) to
> find out.
> 
> Also, if you are getting these "-999.00" because you have read files
> containing them, it might just be easier to code the missing values when
> reading in. Try read.table( file="lala.txt",  na.strings = "-999.00").
> 
> --
> Adaikalavan Ramasamy 
> 
> 
> 
> -----Original Message-----
> From: Laura Quinn [mailto:laura at env.leeds.ac.uk] 
> Sent: Tuesday, October 07, 2003 8:04 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Beginner's query - segmentation fault
> 
> 
> I am dealing with a huge matrix in R (20 columns, 54000 rows) and have
> lots of missing values within the dataset which are currently displayed
> as the value "-999.00" I am trying to create a new matrix (or change the
> existing one) to display these values as "NA" so that I can then perform
> the necessary analysis on the columns within the matrix.
> 
> The matrix name is temp and the column names are t1 to t20 inclusive.
> 
> I have tried the following command:
> 
> temp$t1[temp$t1 == -999.00] <- NA
> 
> and it returns a segmentation fault, can someone tell me what I am doing
> wrong?
> 
> Thanks
> Laura
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list