markdx
2011-Jan-02 00:43 UTC
[R] Example in "Applied Spatial Analysis with R" giving error
Example from page 29, Chapter 2.3 from "Applied Spatial Analysis with R" I am new to R...just trying to replicate the example from the book.> m <- matrix(c(0,0,1,1), ncol = 2, dimnames = list(NULL, + c ("min", > "max")))Error in +c("min", "max") : invalid argument to unary operator Thoughts? -- View this message in context: http://r.789695.n4.nabble.com/Example-in-Applied-Spatial-Analysis-with-R-giving-error-tp3170586p3170586.html Sent from the R help mailing list archive at Nabble.com.
Ben Bolker
2011-Jan-02 02:25 UTC
[R] Example in " Applied Spatial Analysis with R" giving error
markdx <mrkdennehy <at> gmail.com> writes:> > > Example from page 29, Chapter 2.3 from "Applied Spatial Analysis with R" > > I am new to R...just trying to replicate the example from the book. > > > m <- matrix(c(0,0,1,1), ncol = 2, dimnames = list(NULL, + c ("min", > > "max"))) > Error in +c("min", "max") : invalid argument to unary operatorOmit the "+", which is a 'continuation character' indicating that the command in the book was carried over onto a new line. In general line breaks at 'sensible' places are fine: m <- matrix(c(0,0,1,1), ncol = 2, dimnames = list(NULL, c ("min", "max")))