[R] Suggestions for workaround for R Markdown problem with data() ?

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Jan 12 09:23:19 CET 2015


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 op 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 op r-project.org] Namens Molly Elliott
Verzonden: maandag 12 januari 2015 7:06
Aan: r-help op 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 op 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>


More information about the R-help mailing list