[R] Jpg files in R

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Aug 25 21:51:24 CEST 2008


2008/8/25 Henrique Dallazuanna <wwwhsd at gmail.com>:
> Is there the rimage package:
>
>
> if(!require(rimage))install.packages("rimage")
> x <- read.jpeg(system.file("data", "cat.jpg", package="rimage"))

 Nice, but if the require() fails and the package installs via
install.packages, you still have to do the require() (or 'library()'),
so you need something like:

  if(!require(rimage)){ install.packages("rimage") ; require(rimage) }

maybe we need a requireOrGet() function that goes and gets it from
CRAN if it can't find it :)

Barry



More information about the R-help mailing list