[R] readJPEG function cannot open jpeg files

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Jan 14 17:25:19 CET 2013

Being unable to open a file is a related to your operating system and how R interacts with that OS. If your interactive development environment (IDE, of which RStudio is an example) is trying to make things simpler for you but you don't understand how to use it, then you need to ask help from your RStudio support resources, not here.

When posting here, you should mention your results from using base R functions like


as indicated in the Posting Guide mentioned at the bottom of every R-help email.

Consistent with the fact that this is an interface issue between R and the OS, sometimes you will have to investigate the problem from outside R. For example, you might need to investigate issues with security permissions that are OS specific and completely outside the scope of this forum.
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.

Yi Yuan <lambandme at gmail.com> wrote:

>I installed jpeg package and tried to use
>kim<-readJPEG("kim.jpeg") to read in a jpeg file, but R gave me an
>Error in readJPEG("kim.jpeg") : unable to open kim.jpeg
>I already put "kim.jpeg" in Rstudio's default working directory:
>work\Rstudio". So I don't think it's a problem caused by omitting the
>path. But I tried with the full path version just in case and still got
>"unable to open" error:
>kim<-readJPEG("E:\\ home work\\Rstudio\\kim.jpeg")
>Error in readJPEG("E:\\ home work\\Rstudio\\kim.jpeg") :
>  unable to open E:\ home work\Rstudio\kim.jpeg
>So now I really don't know what is wrong.
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list