Molly Elliott
2015-Jan-12 06:06 UTC
[R] Suggestions for workaround for R Markdown problem with data() ?
R version: 3.1.2 (2014-10-31) RStudio version: 0.98.1091 MacOS X Yosemite v. 10.10.1 When I run the following in the console, all is well: data(IlluminaHumanMethylation450kanno.ilmn12.hg19) Yet, when I compile in my .Rmd file, in RStudio (knit to PDF), I get the following error: Error in file(file, "rt") : cannot open the connection Calls: <Anonymous> ... withVisible -> eval -> eval -> read.delim -> read.table -> file Execution halted From what I have read, this could be alleviated by pointing the the source file for data(IlluminaHumanMethylation450kanno.ilmn12.hg19) as opposed to LazyLoading with the data() function. Yet, I?m not sure how to work around this. (This is my first R project ever) The data(IlluminaHumanMethylation450kanno.ilmn12.hg19) is just loading an annotation file from library(IlluminaHumanMethylation450kanno.ilmn12.hg19), and I?m not sure of the file type the data are stored under (.txt, .csv, etc). Thanks in advance! Molly
ONKELINX, Thierry
2015-Jan-12 08:23 UTC
[R] Suggestions for workaround for R Markdown problem with data() ?
Dear Molly, Is the package in which the data is stored loaded in the Rmd? If not try library(yourPackage) data(yourData) or data(yourData, package = "yourPackage") If this doesn't solve your problem, please provide a minimal reproducible example of the problem. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -----Oorspronkelijk bericht----- Van: R-help [mailto:r-help-bounces at r-project.org] Namens Molly Elliott Verzonden: maandag 12 januari 2015 7:06 Aan: r-help at r-project.org Onderwerp: [R] Suggestions for workaround for R Markdown problem with data() ? R version: 3.1.2 (2014-10-31) RStudio version: 0.98.1091 MacOS X Yosemite v. 10.10.1 When I run the following in the console, all is well: data(IlluminaHumanMethylation450kanno.ilmn12.hg19) Yet, when I compile in my .Rmd file, in RStudio (knit to PDF), I get the following error: Error in file(file, "rt") : cannot open the connection Calls: <Anonymous> ... withVisible -> eval -> eval -> read.delim -> read.table -> file Execution halted From what I have read, this could be alleviated by pointing the the source file for data(IlluminaHumanMethylation450kanno.ilmn12.hg19) as opposed to LazyLoading with the data() function. Yet, I?m not sure how to work around this. (This is my first R project ever) The data(IlluminaHumanMethylation450kanno.ilmn12.hg19) is just loading an annotation file from library(IlluminaHumanMethylation450kanno.ilmn12.hg19), and I?m not sure of the file type the data are stored under (.txt, .csv, etc). Thanks in advance! Molly ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. Disclaimer<https://www.inbo.be/nl/disclaimer-mailberichten-van-het-inbo>
Jeff Newmiller
2015-Jan-12 08:41 UTC
[R] Suggestions for workaround for R Markdown problem with data() ?
When you start off by saying it works fine in the console, it starts sounding like not a question that belongs here. It actually is possible to run knitr/rmarkdown in the console without RStudio, so you could try that but to me it sounds suspiciously like a bug in RStudio. Ask on their support forums with a reproducible example. If it turns out to be a bug in the package, keep in mind that that is a Bioconductor package and they, too, have their own support 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. On January 11, 2015 10:06:21 PM PST, Molly Elliott <elliotmo at onid.oregonstate.edu> wrote:>R version: 3.1.2 (2014-10-31) >RStudio version: 0.98.1091 >MacOS X Yosemite v. 10.10.1 > >When I run the following in the console, all is well: >data(IlluminaHumanMethylation450kanno.ilmn12.hg19) > >Yet, when I compile in my .Rmd file, in RStudio (knit to PDF), I get >the following error: >Error in file(file, "rt") : cannot open the connection >Calls: <Anonymous> ... withVisible -> eval -> eval -> read.delim -> >read.table -> file >Execution halted > >From what I have read, this could be alleviated by pointing the the >source file for data(IlluminaHumanMethylation450kanno.ilmn12.hg19) as >opposed to LazyLoading with the data() function. Yet, I?m not sure how >to work around this. (This is my first R project ever) The >data(IlluminaHumanMethylation450kanno.ilmn12.hg19) is just loading an >annotation file from >library(IlluminaHumanMethylation450kanno.ilmn12.hg19), and I?m not sure >of the file type the data are stored under (.txt, .csv, etc). > >Thanks in advance! > >Molly > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.
Yihui Xie
2015-Jan-12 16:41 UTC
[R] Suggestions for workaround for R Markdown problem with data() ?
Can you try to compile your .Rmd file in the R console (instead of clicking the button in RStudio)? rmarkdown::render('your.Rmd') If it gives the same error, please post the traceback() information. I just tried the following minimal example, and I was unable to reproduce your problem. You may also try to reinstall the package: BiocInstaller::biocLite('IlluminaHumanMethylation450kanno.ilmn12.hg19') --- output: pdf_document --- ```{r} library(IlluminaHumanMethylation450kanno.ilmn12.hg19) data(IlluminaHumanMethylation450kanno.ilmn12.hg19) ``` Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Web: http://yihui.name On Mon, Jan 12, 2015 at 12:06 AM, Molly Elliott <elliotmo at onid.oregonstate.edu> wrote:> R version: 3.1.2 (2014-10-31) > RStudio version: 0.98.1091 > MacOS X Yosemite v. 10.10.1 > > When I run the following in the console, all is well: > data(IlluminaHumanMethylation450kanno.ilmn12.hg19) > > Yet, when I compile in my .Rmd file, in RStudio (knit to PDF), I get the following error: > Error in file(file, "rt") : cannot open the connection > Calls: <Anonymous> ... withVisible -> eval -> eval -> read.delim -> read.table -> file > Execution halted > > From what I have read, this could be alleviated by pointing the the source file for data(IlluminaHumanMethylation450kanno.ilmn12.hg19) as opposed to LazyLoading with the data() function. Yet, I?m not sure how to work around this. (This is my first R project ever) The data(IlluminaHumanMethylation450kanno.ilmn12.hg19) is just loading an annotation file from library(IlluminaHumanMethylation450kanno.ilmn12.hg19), and I?m not sure of the file type the data are stored under (.txt, .csv, etc). > > Thanks in advance! > > Molly
Molly Elliott
2015-Jan-12 22:29 UTC
[R] Suggestions for workaround for R Markdown problem with data() ?
My apologies to everyone who offered assistance here. I broke my code chunks up some more, and further isolated the problem line to a different function. Yihui, Thank you for the information for running the .Rmd file within R itself, rather than RStudio. I have installed pandoc and like that I can work straight in R. Thierry, Thank you for the suggestions as well, your advice helped me to realize my mistake in posting my question. Jeff, Thanks for your advice on intelligent posting! I wasn?t sure where to start, and hummed and hawed over it for a day, but better understand how the mailing list works now. Best, Molly> On Jan 12, 2015, at 8:41 AM, Yihui Xie <xie at yihui.name> wrote: > > Can you try to compile your .Rmd file in the R console (instead of > clicking the button in RStudio)? > > rmarkdown::render('your.Rmd') > > If it gives the same error, please post the traceback() information. I > just tried the following minimal example, and I was unable to > reproduce your problem. You may also try to reinstall the package: > BiocInstaller::biocLite('IlluminaHumanMethylation450kanno.ilmn12.hg19') > > --- > output: pdf_document > --- > > ```{r} > library(IlluminaHumanMethylation450kanno.ilmn12.hg19) > data(IlluminaHumanMethylation450kanno.ilmn12.hg19) > ``` > > > Regards, > Yihui > -- > Yihui Xie <xieyihui at gmail.com> > Web: http://yihui.name > > > On Mon, Jan 12, 2015 at 12:06 AM, Molly Elliott > <elliotmo at onid.oregonstate.edu> wrote: >> R version: 3.1.2 (2014-10-31) >> RStudio version: 0.98.1091 >> MacOS X Yosemite v. 10.10.1 >> >> When I run the following in the console, all is well: >> data(IlluminaHumanMethylation450kanno.ilmn12.hg19) >> >> Yet, when I compile in my .Rmd file, in RStudio (knit to PDF), I get the following error: >> Error in file(file, "rt") : cannot open the connection >> Calls: <Anonymous> ... withVisible -> eval -> eval -> read.delim -> read.table -> file >> Execution halted >> >> From what I have read, this could be alleviated by pointing the the source file for data(IlluminaHumanMethylation450kanno.ilmn12.hg19) as opposed to LazyLoading with the data() function. Yet, I?m not sure how to work around this. (This is my first R project ever) The data(IlluminaHumanMethylation450kanno.ilmn12.hg19) is just loading an annotation file from library(IlluminaHumanMethylation450kanno.ilmn12.hg19), and I?m not sure of the file type the data are stored under (.txt, .csv, etc). >> >> Thanks in advance! >> >> Molly