sunny
sunny

Reputation: 3891

littler doesn't see installed package

I'm having a problem getting littler to see an installed packaged. I've gotten it down to just trying to fun this one line saved in a file called min.R

require(jsonlite)

I can execute this line of code and load the package just fine running the R terminal, but if I try this from the command line I get an error that jsonlite is not found:

root# r min.R
Loading required package: jsonlite
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘jsonlite’

Why is this happening and how can I fix it?

Additional details:

If I try require(zoo) this works fine when run from littler. Here is some of the output of installed.packages() in relevant part:

           Enhances
jsonlite   NA
...
zoo        NA

           License                       License_is_FOSS License_restricts_use
jsonlite   "MIT + file LICENSE"          NA              NA
...
zoo        "GPL-2 | GPL-3"               NA              NA
           OS_type MD5sum NeedsCompilation Built
jsonlite   NA      NA     "yes"            "3.0.2"
...
zoo        NA      NA     "yes"            "3.0.2" 

Upvotes: 0

Views: 214

Answers (2)

Dirk is no longer here
Dirk is no longer here

Reputation: 368439

Sorry, I missed this when it was originally posted.

In the past littler read nothing. I then added /etc/littler.r and ~/.littler.r support. The next version will read /etc/R/Rprofile.site and ~/.Rprofile as well.

So for now just put some code into ~/.littler.r. As for not finding things, check via

$ r -e 'print(.libPaths())'

Upvotes: 1

sunny
sunny

Reputation: 3891

I never found an answer but this issue was not reproduced using RJSONIO so I switched to that package. I did try reinstalling littler, R, and jsonlite but the problem remained.

Upvotes: 0

Related Questions