[R] Modifying Package Data

Suzen, Mehmet msuzen at gmail.com
Wed Feb 6 22:07:17 CET 2013


You can use system.file to fine the package root, then
data file path relative to this.
For example
system.file(package = "stats") # The root of package 'stats'

See ?system.file

On 6 February 2013 22:02, David Winsemius <dwinsemius at comcast.net> wrote:
>
> On Feb 4, 2013, at 11:37 AM, Rich Shepard wrote:
>
>>  The bio.infer package contains a data frame
>> /usr/lib/R/library/bio.infer/data/itis.ttable.rda that needs to be modified.
>> After loading the bio.infer package and attaching the data frame with the
>> data() function, I wrote the data frame to a text file.
>>
>>  After adding another row to the data frame I applied read.table() to
>> create a data frame, but it's in my pwd, not the R library data subdirectory
>> for the bio.infer package.
>>
>>  What is the R function to copy/save/write either the text file or the
>> local copy of itis.ttable to
>> /usr/lib/R/library/bio.infer/data/itis.ttable.rda?
>
> Wouldn't this just be:
>
> save(itis.table, file="/usr/lib/R/library/bio.infer/data/itis.ttable.rda")
>
> ????
>
> --
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> 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.



More information about the R-help mailing list