Never mind; I had a brain cramp and confused the value returned from data() with the actions taken. My data objects were properly loaded into my environment.

Apologies to this list.

Carl

On 1/28/22 3:23 PM, Jeff Newmiller wrote:
I am not aware of R files being converted to rda... I generate an rda file and 
put it into the data directory myself. However, like most of the participants 
on this list, I do not claim particular expertise in building packages... that 
topic is what the R-package-devel list mentioned in the Posting Guide is for 
(hint).

On January 28, 2022 11:46:35 AM PST, Carl Witthoft <c...@witthoft.com> wrote:
When I run the shell command

R CMD BUILD mypackage

the builder converts *.R files to *.rda data files.  This seems to
conflict with the information in R-Exts which says a package's  /data
directory can contain  foo.R files which the function data() will call
source() to execute.
In my case, I have a  foo.R file in the /data directory which contains
the following (adapted for size and clarity:


# some comment text
dataA <- '3.1415'
# more comments
dataB <- '2.71828'

The builder converted foo.R to foo.rda, and when I use either data() or
load() all I get is  a char vector containing the text

[1] 'dataA'
[2] 'dataB'

Where did I go wrong?

thanks



--
Carl Witthoft
c...@witthoft.com
resume: https://app.box.com/file/498153801347

______________________________________________
R-help@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.

Reply via email to