[R] asking about R Code

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sat Oct 27 01:42:58 CEST 2012


You seem to be quite lost. You should execute one statement at a time, and troubleshoot from there. I suspect that your attempts to get your file in the right place went wrong, or the file is the wrong type of file for that function (regardless of the name you gave it).

As for giving you an explanation about read.pnm, I would rather not. There is documentation available on any library function using the "?" command in R, e.g.

?read.pnm

You should not have to "replace" files with other files in order to read them... you should be able to specify another name within the quotes. You may learn a bit about your current directory by using the getwd() function and the list.files() function. Once you have successfully read in the data, you can learn more about the object by following the useful hyperlinks in the documentation for read.pnm.

I highly recommend reading the Introduction to R pdf that is supplied with your R software, and then reading the posting guide mentioned at the bottom of any email on this list. If your project is of an academic nature, the posting guide will remind you that this is not the place to ask homework questions... that is for you to obtain from your educational institution.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Ellen Praman <ellen.pramana91 at yahoo.com> wrote:

>Hi, my name is Ellen. I want to ask you about R Code.
>I got a code for extracting a pixel value, but I can't compile it..�
>It is said "Error in is.data.frame(x) : object 'lena' not found"
>
>Here is the original full code:
>
>library(pixmap)
>lena <- read.pnm("oldlennablur.pgm")
>write.table(lena at grey,"mylenna", quote=FALSE, row.names = FALSE,
>col.names= FALSE)
>plot(pixmapGrey(as.matrix(read.table("mylenn"))))
>
>do you know why i got the error? i have change the�"oldlennablur.pgm"
>with the one i have and also with the specified path on my computer..|
>And would you like give me an explanation about "read.pnm". I need to
>know what result will i get using this syntax.
>Does this syntax give us a 256x256 matrix if we input the 256x256
>pixels image?
>I will use the data for my project, so I need to know how and what the
>data i would get..
>Thank you very much..�
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------------------------------------------------
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list