Re: [R] path and R CMD check

From: Christophe Genolini <cgenolin_at_u-paris10.fr>
Date: Fri, 25 Jul 2008 05:34:39 -0700 (PDT)

Uwe Ligges-3 wrote:
>
>
>
> Christophe Genolini wrote:

>> Hi the list,
>> 
>> When I developpe my code, I put the file that define all the functions 
>> in ./MyPack/R/prog.R and the tests in ./MyPack/tests/testsProg.R
>> The test files start by
>> 
>> load("../data/myData.rda")
>> source("../R/prog.R")
>> #test function number one...
>> 
>> But "R CMD check MyPack" does not find the file myData.rda.
>> Does someone knows what is wrong ?

>
>
> Read Writing R Extensions, learn how a package works (and yes, it works
> without sourcing files separately since the package mechanism does the
> job for you) and just say:
>
> library("packagename")
> data("myData")
>
> Best wishes,
> Uwe Ligges
>
>
I try but I find it very hard. Do you have more precision about the part that explain it ? I read it several time, but I did not find that much on tests.

So I do it on my own way. But I would love to know more about the way used by real programmer.

So far :

Before today, I was starting by
> load("../data/myData.rda")
> source("../R/prog.R")

But you tell me to do :
> library("myPack")
> data("myData")

Using this system is problematic during the development phase, since the package is not ready and library(myPack) will not work

Any advice for a better way of working ?

Christophe

-- 
View this message in context: http://www.nabble.com/path-and-R-CMD-check-tp18622300p18650854.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.
Received on Fri 25 Jul 2008 - 12:37:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 13:32:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive