Closed trestletech closed 7 years ago
Thanks for the issue @trestletech
Not sure what the right answer is here, but what about loading the datasets in onLoad?
Made the change in https://github.com/sckott/analogsea/tree/datasets branch - thoughts?
Hm... I may have not restarted my session properly, but I'm not getting
> analogsea::droplet_create()
Using default ssh keys: trestle-secure-rsa
Error in sample(x, size = 1) : object 'adjectives' not found
In addition: Warning messages:
1: In utils::data("words") : data set ‘words’ not found
2: In utils::data("adjectives") : data set ‘adjectives’ not found
3: In utils::data("nouns") : data set ‘nouns’ not found
>
unfortunately, I'd have to brush up on my R package loading details before I'd be qualified to give a meaningful code review here. Just trying to test empirically.
It's entirely possible that the above message is user error, so feel free to disregard if you think your branch fixes things.
you did install from datasets
branch?
I did, indeed. And then I restarted the R session and that was the result I got. This is, of course, without having analogsea library()'d or otherwise loaded.
okay, i'll take another look at that branch
can you try again after reinstalling from datasets
- moved the data sets into the package in an R file as vectors. still works for me, but question is does work for you
Perfect! Had to downgrade openssl to get around #126 but once I did that I was able to run the following just fine:
> devtools::install_github("sckott/analogsea", ref="datasets")
> analogsea::droplet_create()
great!
sorted in b948b19
I'm a bit rusty on my R package import lifetime, so pardon me for not being of more help with a suggested fix here, but...
If I attempt to use analogsea without first
library()
ing it, most things seem to work, however generating a random name for an image does not because of failures in the random name generation.It looks like the adjectives and nouns variables need to be made available earlier in the package lifetime in order to be used by these functions.
The more obvious workaround to the one above is just to call
library(analogsea)
which makes those datasets available and then everything just works out the box like you'd expect.I'm not sure what impact this would have on packages that want to import analogsea, but I suspect I'll find out momentarily! ;)