An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130205/40f928ec/attachment.pl>
converting 0 to NAN in SpatialGridDataFrame
7 messages · Lionel, Etienne B. Racine, Wesley Roberts
Dear Wesley, You can access the data components of a SpatialGridDataFrame using @data, and then classic data frame operation can be done , in your example this would be: TC1.dte1 at data[TC1.dte1 at data==0]<-NA Hope this help, Lionel Le 05/02/2013 16:15, Wesley Roberts a ?crit :
Dear R-sig-geo I have been searching for a way to convert 0s to NAN in R but have not had any luck. I have tried the following with no luck is.na(TC1.dte1)<-TC1.dte1<=0 TC1.dte1[is.na(TC1.dte1)]<=0 TC1.dte1[TC1.dte1==0]<-NA What I would like to do is to remove all 0s from TC1.dte1 and replace them with NA or NANs. The 0s are a mask which I dont want to alter in subsequent work. My data is in a SpatialGridDataFrame and was imported into R using rgdal. Many thanks for your help and inputs, Wesley
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130205/c3d05a56/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130205/a25b7759/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130205/75889367/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130205/71a801fb/attachment.pl>
1 day later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130207/e51d4cee/attachment.pl>