Is it possible to read jpeg files into R? If yes please guide, Thanks.. I tried to search many time but failed to do. Thankis in advance.. with Best Regards, Malik Shahzad Visiting Researcher National Institute of Informatics (NII) Tokyo, Japan Doctoral Student Asian Institute of Technology (AIT) Bangkok, Thailand +66-8-7676-5616 [[alternative HTML version deleted]]
Malik Shahzad <geomalik <at> live.com> writes:> > > Is it possible to read jpeg files into R? > > If yes please guide, Thanks.. I tried to search many time but failed to do. >install.packages("sos") library("sos") findFn("read jpeg") (I initially tried findFn("import jpeg") and didn't get any hits, then tried findFn("jpeg") and scrolled down to find these results)
On Sat, 25 Sep 2010, Malik Shahzad wrote:> > Is it possible to read jpeg files into R? > > If yes please guide, Thanks.. I tried to search many time but failed to do.On my system ??jpeg gave ReadImages::read.jpeg Read JPEG file biOps::readJpeg Read jpeg file rimage::read.jpeg Read JPEG file There are a number of other possibilities, including EBImage::readImage from Bioconductor which uses ImageMagick to convert the file format (and that or many other image convertors could be used in a simple R wrapper).> > Thankis in advance.. > > with Best Regards, > > Malik Shahzad > Visiting Researcher > National Institute of Informatics (NII) > Tokyo, Japan > > Doctoral Student > Asian Institute of Technology (AIT) > Bangkok, Thailand > +66-8-7676-5616 > > > > > [[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. >-- Brian D. Ripley, ripley at 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, UK Fax: +44 1865 272595
I was looking for an example of complex variables in R. This one is trivial, but rather cute (though World War II aficionados may 'come over all funny'). See if you can guess the image before you try the function. It's not difficult. jif <- function(res = 100) { z <- sample(do.call(complex, subset(expand.grid(real seq(-3, 4, len = 7*res + 1), imaginary seq(-2, 2, len = 4*res + 1)), real > -2.439 & real < 3.717))) del <- 2*base::pi/32 plot(z, type = "n", asp = 1, ann = FALSE, axes = FALSE) points(z[((Arg(z) + del/2) %/% del) %% 2 == 0 | Mod(z) < 1.15], col = "red", pch = ".") } Njoi. Bill Venables.
In a context of spatial analysis, see also readGDAL in package rgdal: library(rgdal) logo <- system.file("pictures/logo.jpg", package="rgdal")[1] x <- readGDAL(logo) image(x) Renaud 2010/9/25 Prof Brian Ripley <ripley at stats.ox.ac.uk>:> On Sat, 25 Sep 2010, Malik Shahzad wrote: > >> >> Is it possible to read jpeg files into R? >> >> If yes please guide, Thanks.. I tried to search many time but failed to >> do. > > On my system ??jpeg gave > > ReadImages::read.jpeg ? Read JPEG file > biOps::readJpeg ? ? ? ? Read jpeg file > rimage::read.jpeg ? ? ? Read JPEG file > > There are a number of other possibilities, including > EBImage::readImage from Bioconductor which uses ImageMagick to convert the > file format (and that or many other image convertors could be used in a > simple R wrapper). > >> >> Thankis in advance.. >> >> with Best Regards, >> >> Malik Shahzad >> Visiting Researcher >> National Institute of Informatics (NII) >> Tokyo, Japan >> >> Doctoral Student >> Asian Institute of Technology (AIT) >> Bangkok, Thailand >> +66-8-7676-5616 >> >> >> >> >> ? ? ? ?[[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. >> > > -- > Brian D. Ripley, ? ? ? ? ? ? ? ? ?ripley at 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, UK ? ? ? ? ? ? ? ?Fax: ?+44 1865 272595 > > ______________________________________________ > 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.-- Renaud Lancelot EDEN Project, coordinator http://www.eden-fp6project.net/ UMR CIRAD-INRA "Contr?le des maladies animales exotiques et ?mergentes" Joint research unit "Control of emerging and exotic animal diseases" CIRAD, Campus International de Baillarguet TA A-DIR / B F34398 Montpellier http://umr-cmaee.cirad.fr/ Tel.? +33 4 67 59 37 17? -? Fax? +33 4 67 59 37 95 Secr. +33 4 67 59 37 37? - Cell. +33 6 77 52 08 69