Re: [R] readJPEG function cannot open jpeg files

2013-01-15 Thread Rolf Turner

On 01/15/2013 08:04 AM, Duncan Murdoch wrote:

SNIP


I've never understood why Microsoft thinks it is good to display 
incomplete filenames.  This practice causes so many problems.


SNIP

Personally, I never understand Why Microsoft?.

cheers,

Rolf Turner

__
R-help@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.


[R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
I installed jpeg package and tried to use

 kim-readJPEG(kim.jpeg) to read in a jpeg file, but R gave me an error:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory: E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the file's
path. But I tried with the full path version just in case and still got the
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@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Suzen, Mehmet
Similar issue with URLs:

 yesWeCan - 
 http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg;
 url(yesWeCan)
  description
http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg;
class
url
 mode
  r
 text
   text
   opened
 closed
 can read
yes
can write
 no
 readJPEG(yesWeCan)
Error in readJPEG(yesWeCan) :
  unable to open
http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg


On 14 January 2013 14:57, Yi Yuan lamban...@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:
 Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

 I already put kim.jpeg in Rstudio's default working directory: E:\home
 work\Rstudio. So I don't think it's a problem caused by omitting the file's
 path. But I tried with the full path version just in case and still got the
 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@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.

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Jeff Newmiller
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

?sessionInfo
?getwd
?list.files

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 NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Yi Yuan lamban...@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:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory:
E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the
file's
path. But I tried with the full path version just in case and still got
the
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@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.

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread William Dunlap
You can use file.info(myFile) to make sure the file exists and has 
appropriate permissions (mode
in file.info's lingo, as in Unix).  E.g.,

 file.info(c:/temp/BO.jpeg) # this one does not exist
size isdir mode mtime ctime atime  exe
c:/temp/BO.jpeg   NANA NA  NA  NA  NA NA
 file.info(c:/temp/BO.jpg) # this one exists
 size isdir mode   mtime   ctime
   atime
c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09 
2013-01-14 08:33:09
   exe
c:/temp/BO.jpg  no

I can readJPEG() the file with mode 666, but not all permission information is 
encoded in the mode. 

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of Jeff Newmiller
 Sent: Monday, January 14, 2013 8:25 AM
 To: Yi Yuan; r-help@r-project.org
 Subject: Re: [R] readJPEG function cannot open jpeg files
 
 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
 
 ?sessionInfo
 ?getwd
 ?list.files
 
 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 NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.
 
 Yi Yuan lamban...@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:
 Error in readJPEG(kim.jpeg) : unable to open kim.jpeg
 
 I already put kim.jpeg in Rstudio's default working directory:
 E:\home
 work\Rstudio. So I don't think it's a problem caused by omitting the
 file's
 path. But I tried with the full path version just in case and still got
 the
 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@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.
 
 __
 R-help@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.

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Prof Brian Ripley

On 14/01/2013 16:26, Suzen, Mehmet wrote:

Similar issue with URLs:


Not a similar issue at all: a URL is not a file.  That most functions in 
R itself open connections including URLs does not mean that contributed 
packages do.  The package help is quite specific about its requirements.


  source: Either name of the file to read from or a raw vector
  representing the JPEG file content.

Which suggests to you how you can do this, apart from download.file, of 
course.  Something like


readJPEG(readBin(yesWeCan, raw, 1e6))




yesWeCan - 
http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg;
url(yesWeCan)

   description
http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg;
 class
 url
  mode
   r
  text
text
opened
  closed
  can read
 yes
 can write
  no

readJPEG(yesWeCan)

Error in readJPEG(yesWeCan) :
   unable to open
http://upload.wikimedia.org/wikipedia/commons/9/9d/Barack_Obama.jpg


On 14 January 2013 14:57, Yi Yuan lamban...@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:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory: E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the file's
path. But I tried with the full path version just in case and still got the
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@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.


__
R-help@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.




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Felipe Carrillo
I have used the biOps package to read pictures and it works fine.
For example you can plot a pic just by:
library(biOps)
x - readJpeg(mypic.jpg)  ##mypic should be in you working directory
plot(x)

Notice that is only one uppercase letter on readJpeg and mypic is jpg not 
jpeg


Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish  Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx




From: William Dunlap wdun...@tibco.com
To: Jeff Newmiller jdnew...@dcn.davis.ca.us; Yi Yuan lamban...@gmail.com; 
r-help@r-project.org r-help@r-project.org 
Sent: Monday, January 14, 2013 8:44 AM
Subject: Re: [R] readJPEG function cannot open jpeg files

You can use file.info(myFile) to make sure the file exists and has 
appropriate permissions (mode
in file.info's lingo, as in Unix).  E.g.,

 file.info(c:/temp/BO.jpeg) # this one does not exist
                size isdir mode mtime ctime atime  exe
c:/temp/BO.jpeg  NA    NA NA  NA  NA  NA NA
 file.info(c:/temp/BO.jpg) # this one exists
                size isdir mode              mtime              ctime          
    atime
c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09 
2013-01-14 08:33:09
              exe
c:/temp/BO.jpg  no

I can readJPEG() the file with mode 666, but not all permission information is 
encoded in the mode. 

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of Jeff Newmiller
 Sent: Monday, January 14, 2013 8:25 AM
 To: Yi Yuan; r-help@r-project.org
 Subject: Re: [R] readJPEG function cannot open jpeg files
 
 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
 
 ?sessionInfo
 ?getwd
 ?list.files
 
 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:jdnew...@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 lamban...@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:
 Error in readJPEG(kim.jpeg) : unable to open kim.jpeg
 
 I already put kim.jpeg in Rstudio's default working directory:
 E:\home
 work\Rstudio. So I don't think it's a problem caused by omitting the
 file's
 path. But I tried with the full path version just in case and still got
 the
 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@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.
 
 __
 R-help@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.

__
R-help@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.



[[alternative HTML version deleted]]

__
R-help@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

[R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
Hi, r-help mailing list subscribers,

I installed jpeg package and tried to use

 kim-readJPEG(kim.jpeg) to read in a jpeg file, but R gave me an error:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory: E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the file's
path. But I tried with the full path version just in case and still got the
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. Thanks for your help!

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
Thanks William !

 file.info(E:/ home work/Rstudio/kim.jpeg)
   size isdir mode mtime ctime atime
 exe
E:/home work/Rstudio/kim.jpeg   NANA NA  NA  NA  NA NA

So R thinks this file doesn't exist? But the file is already in E:/ home
work/Rstudio folder, I don't understand why file.info( ) returned such
message. I have multiple files in this directory E:/home work/Rstudio,
but R shows:
file.info(E:/home work/Rstudio)
 size isdir mode
mtime   ctime   atime exe
E:/home work/Rstudio0  TRUE  777 2013-01-13 22:12:58 2013-01-13
20:57:36 2013-01-13 22:12:58  no

 Any help ?

On Mon, Jan 14, 2013 at 11:44 AM, William Dunlap wdun...@tibco.com wrote:

 You can use file.info(myFile) to make sure the file exists and has
 appropriate permissions (mode
 in file.info's lingo, as in Unix).  E.g.,

  file.info(c:/temp/BO.jpeg) # this one does not exist
 size isdir mode mtime ctime atime  exe
 c:/temp/BO.jpeg   NANA NA  NA  NA  NA NA
  file.info(c:/temp/BO.jpg) # this one exists
  size isdir mode   mtime   ctime
 atime
 c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09
 2013-01-14 08:33:09
exe
 c:/temp/BO.jpg  no

 I can readJPEG() the file with mode 666, but not all permission
 information is encoded in the mode.

 Bill Dunlap
 Spotfire, TIBCO Software
 wdunlap tibco.com

  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf
  Of Jeff Newmiller
  Sent: Monday, January 14, 2013 8:25 AM
  To: Yi Yuan; r-help@r-project.org
  Subject: Re: [R] readJPEG function cannot open jpeg files
 
  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
 
  ?sessionInfo
  ?getwd
  ?list.files
 
  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 NewmillerThe .   .  Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
Live:   OO#.. Dead: OO#..  Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
  /Software/Embedded Controllers)   .OO#.   .OO#.
  rocks...1k
 
 ---
  Sent from my phone. Please excuse my brevity.
 
  Yi Yuan lamban...@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:
  Error in readJPEG(kim.jpeg) : unable to open kim.jpeg
  
  I already put kim.jpeg in Rstudio's default working directory:
  E:\home
  work\Rstudio. So I don't think it's a problem caused by omitting the
  file's
  path. But I tried with the full path version just in case and still got
  the
  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@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.
 
  __
  R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
Hi, guys, my problem is solved.
I used file.info(list.files(getwd(),full.names=TRUE)) and found out that
the said file is listed as kim.jpg instead of kim.jpeg. So
kim-readJPEG(kim.jpg) worked. Thanks for your help and sorry for my
newbie question.


On Mon, Jan 14, 2013 at 11:59 AM, Yi Yuan lamban...@gmail.com wrote:

 Thanks William !

  file.info(E:/ home work/Rstudio/kim.jpeg)
size isdir mode mtime ctime atime
  exe
 E:/home work/Rstudio/kim.jpeg   NANA NA  NA  NA  NA NA

 So R thinks this file doesn't exist? But the file is already in E:/ home
 work/Rstudio folder, I don't understand why file.info( ) returned such
 message. I have multiple files in this directory E:/home work/Rstudio,
 but R shows:
 file.info(E:/home work/Rstudio)
  size isdir mode
 mtime   ctime   atime exe
 E:/home work/Rstudio0  TRUE  777 2013-01-13 22:12:58 2013-01-13
 20:57:36 2013-01-13 22:12:58  no

  Any help ?

 On Mon, Jan 14, 2013 at 11:44 AM, William Dunlap wdun...@tibco.comwrote:

 You can use file.info(myFile) to make sure the file exists and has
 appropriate permissions (mode
 in file.info's lingo, as in Unix).  E.g.,

  file.info(c:/temp/BO.jpeg) # this one does not exist
 size isdir mode mtime ctime atime  exe
 c:/temp/BO.jpeg   NANA NA  NA  NA  NA NA
  file.info(c:/temp/BO.jpg) # this one exists
  size isdir mode   mtime   ctime
   atime
 c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09
 2013-01-14 08:33:09
exe
 c:/temp/BO.jpg  no

 I can readJPEG() the file with mode 666, but not all permission
 information is encoded in the mode.

 Bill Dunlap
 Spotfire, TIBCO Software
 wdunlap tibco.com

  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf
  Of Jeff Newmiller
  Sent: Monday, January 14, 2013 8:25 AM
  To: Yi Yuan; r-help@r-project.org
  Subject: Re: [R] readJPEG function cannot open jpeg files
 
  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
 
  ?sessionInfo
  ?getwd
  ?list.files
 
  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 NewmillerThe .   .  Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
Live:   OO#.. Dead: OO#..  Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
  /Software/Embedded Controllers)   .OO#.   .OO#.
  rocks...1k
 
 ---
  Sent from my phone. Please excuse my brevity.
 
  Yi Yuan lamban...@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:
  Error in readJPEG(kim.jpeg) : unable to open kim.jpeg
  
  I already put kim.jpeg in Rstudio's default working directory:
  E:\home
  work\Rstudio. So I don't think it's a problem caused by omitting the
  file's
  path. But I tried with the full path version just in case and still got
  the
  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@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.
 
  __
  R-help@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.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Duncan Murdoch

On 13-01-14 11:59 AM, Yi Yuan wrote:

Thanks William !

  file.info(E:/ home work/Rstudio/kim.jpeg)
size isdir mode mtime ctime atime
  exe
E:/home work/Rstudio/kim.jpeg   NANA NA  NA  NA  NA NA

So R thinks this file doesn't exist? But the file is already in E:/ home
work/Rstudio folder, I don't understand why file.info( ) returned such
message. I have multiple files in this directory E:/home work/Rstudio,
but R shows:
file.info(E:/home work/Rstudio)
  size isdir mode
mtime   ctime   atime exe
E:/home work/Rstudio0  TRUE  777 2013-01-13 22:12:58 2013-01-13
20:57:36 2013-01-13 22:12:58  no

  Any help ?


You seem to sometimes have spaces ahead of home and sometimes not.

What I recommend most people do on Windows is not to try to type the 
filename yourself, use file.choose() or choose.files() to get a dialog 
box and pick it out of there.


Duncan Murdoch



On Mon, Jan 14, 2013 at 11:44 AM, William Dunlap wdun...@tibco.com wrote:


You can use file.info(myFile) to make sure the file exists and has
appropriate permissions (mode
in file.info's lingo, as in Unix).  E.g.,


file.info(c:/temp/BO.jpeg) # this one does not exist

 size isdir mode mtime ctime atime  exe
c:/temp/BO.jpeg   NANA NA  NA  NA  NA NA

file.info(c:/temp/BO.jpg) # this one exists

  size isdir mode   mtime   ctime
 atime
c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09
2013-01-14 08:33:09
exe
c:/temp/BO.jpg  no

I can readJPEG() the file with mode 666, but not all permission
information is encoded in the mode.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

On Behalf

Of Jeff Newmiller
Sent: Monday, January 14, 2013 8:25 AM
To: Yi Yuan; r-help@r-project.org
Subject: Re: [R] readJPEG function cannot open jpeg files

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


?sessionInfo
?getwd
?list.files

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 NewmillerThe .   .  Go

Live...

DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live

Go...

   Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.

  rocks...1k



---

Sent from my phone. Please excuse my brevity.

Yi Yuan lamban...@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:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory:
E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the
file's
path. But I tried with the full path version just in case and still got
the
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@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.


__
R-help@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.




[[alternative HTML version deleted]]

__
R-help@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

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Duncan Murdoch

On 13-01-14 12:18 PM, Yi Yuan wrote:

Hi, guys, my problem is solved.
I used file.info(list.files(getwd(),full.names=TRUE)) and found out that
the said file is listed as kim.jpg instead of kim.jpeg. So
kim-readJPEG(kim.jpg) worked. Thanks for your help and sorry for my
newbie question.


Another recommendation I make for all Windows users is to change the 
Explorer options to display full filenames.  That would have prevented 
this error.  (This is an option in Windows, not in R.)


I've never understood why Microsoft thinks it is good to display 
incomplete filenames.  This practice causes so many problems.


Duncan Murdoch







On Mon, Jan 14, 2013 at 11:59 AM, Yi Yuan lamban...@gmail.com wrote:


Thanks William !

  file.info(E:/ home work/Rstudio/kim.jpeg)
size isdir mode mtime ctime atime
  exe
E:/home work/Rstudio/kim.jpeg   NANA NA  NA  NA  NA NA

So R thinks this file doesn't exist? But the file is already in E:/ home
work/Rstudio folder, I don't understand why file.info( ) returned such
message. I have multiple files in this directory E:/home work/Rstudio,
but R shows:
file.info(E:/home work/Rstudio)
  size isdir mode
mtime   ctime   atime exe
E:/home work/Rstudio0  TRUE  777 2013-01-13 22:12:58 2013-01-13
20:57:36 2013-01-13 22:12:58  no

  Any help ?

On Mon, Jan 14, 2013 at 11:44 AM, William Dunlap wdun...@tibco.comwrote:


You can use file.info(myFile) to make sure the file exists and has
appropriate permissions (mode
in file.info's lingo, as in Unix).  E.g.,


file.info(c:/temp/BO.jpeg) # this one does not exist

 size isdir mode mtime ctime atime  exe
c:/temp/BO.jpeg   NANA NA  NA  NA  NA NA

file.info(c:/temp/BO.jpg) # this one exists

  size isdir mode   mtime   ctime
   atime
c:/temp/BO.jpg 150536 FALSE  666 2013-01-14 08:35:32 2013-01-14 08:33:09
2013-01-14 08:33:09
exe
c:/temp/BO.jpg  no

I can readJPEG() the file with mode 666, but not all permission
information is encoded in the mode.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

On Behalf

Of Jeff Newmiller
Sent: Monday, January 14, 2013 8:25 AM
To: Yi Yuan; r-help@r-project.org
Subject: Re: [R] readJPEG function cannot open jpeg files

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


?sessionInfo
?getwd
?list.files

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 NewmillerThe .   .  Go

Live...

DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live

Go...

   Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.

  rocks...1k



---

Sent from my phone. Please excuse my brevity.

Yi Yuan lamban...@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:
Error in readJPEG(kim.jpeg) : unable to open kim.jpeg

I already put kim.jpeg in Rstudio's default working directory:
E:\home
work\Rstudio. So I don't think it's a problem caused by omitting the
file's
path. But I tried with the full path version just in case and still got
the
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@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.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Suzen, Mehmet
On 14 January 2013 18:56, Prof Brian Ripley rip...@stats.ox.ac.uk wrote:
 On 14/01/2013 16:26, Suzen, Mehmet wrote:

 Similar issue with URLs:


 Not a similar issue at all: a URL is not a file.  That most functions in R
 itself open connections including URLs does not mean that contributed
 packages do.  The package help is quite specific about its requirements.

   source: Either name of the file to read from or a raw vector
   representing the JPEG file content.

 Which suggests to you how you can do this, apart from download.file, of
 course.  Something like

 readJPEG(readBin(yesWeCan, raw, 1e6))


 Dear Prof. Ripley,

Thank you for the correction. I was thinking in the lines of
'Everything is a file' concept.
(http://en.wikipedia.org/wiki/Everything_is_a_file).

Best,
-m

__
R-help@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.