I am facing a problem that you might already have seen : I am trying to create a Shiny app using dygraphs. But, for the first time, when I call the library(dygraphs), in my ui.R file, I get an error :
ERROR: there is no package called ‘dygraphs’
I checked whether it was correctly installed on my server :
installed.packages() gives me the line :
OS_type MD5sum NeedsCompilation Built
dygraphs NA NA "no" "3.2.1"
require(dygraphs) gives me :
Loading required package: dygraphs
I have the same version of R on my computer and my server, which is :
R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
And, the weirdest thing : my code works on my computer (with runApp() on Rstudio), but not on my server.
If anyone know how to cope with this problem... Thanks a bunch !
I found the solution, it's possible to see the dependencies of a package with CRAN : https://cran.r-project.org/web/packages/dygraphs/index.html
And eventually, the following line does the trick !
install.packages(c("htmlwidgets","xts","zoo","rmarkdown","yaml","dygraphs"),lib="/usr/local/lib/R/site-library",dependencies=TRUE)
Enjoy :)
Related
Having some issues helping a colleague at work install RStudio. She was getting the following error message whenever she opened up the programme and when trying to install new packages.
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Seems to be the error that's being discussed here. We've followed the steps in the answers and haven't had any luck.
Uninstalled the yaml package, reinstalled RStudio and got a different error message (not surprising given the package was no longer installed).
Error in loadNamespace(name) : there is no package called ‘yaml’
Error in loadNamespace(name) : there is no package called ‘yaml’
Then tried each of the answers in the link and ended up with the original error message again.
Beyond what I've googled in the past 15 minutes, I don't know anything about yaml or what it's supposed to do. Opening R rather than RStudio seems to work as it should.
R version is 3.4.3, RStudio is 1.1.423 for Windows and yaml version that was originally installed was 2.1.16. Not sure if it's relevant, but we are on work laptops that require us to install new programmes (and in the case of R, packages) into C:\Users\NAME\Desktop\My Software, but that seems to have been done correctly.
Any help greatly appreciated.
Thanks,
James
I am very new to this community.
My aim is to use R for statistical analysis but some errors occurred.
In the first step, I want to load the "XLConnect"-package, in order to open an xlsx-data file, with this code:
install.packages('XLConnect')
library(XLConnect)
Answer was "package ‘XLConnect’ successfully unpacked and MD5 sums checked", after which the following error was given:
Error in library(XLConnect) : the package ‘XLConnect’ doesn't exist.
I also tried the xlsx package, but in this case always got:
Error in -library('openxlsx') : invalid argument to unary operator
or, that the package openxlsx, doesn't exist but some line before it told me the download, installation and check sums were correct!
Additionally, when I try to change the directory in a script, using
getwd(), the following error occurs:
Error in -getwd() : invalid argument to unary operator
When I type it in the console it works.
I downloaded R here: https://cran.r-project.org/bin/windows/base, installed R version 3.4.3 as well as R Studio.
I already looked in the community for some hints but neither could solve my problem:
XLConnect function is not passing argument to system.file
Error when installing XLConnect in RStudio
MY OS is Windows 10, I tried the 32-bit as well as the 64-bit version of R and installed fitting Java-Versions for both verisons( that was the first error that occured but now isn't there anymore).
I tried to load the packages from several CRAN-Mirrors but always the same error occurs (e.g. Germany(Göttingen),Germany(Münster), Belgium(Ghent) or Switzerland ).
Maybe I missed some very basic setting. Is the information I provided enough or do you need more?
Thanks a lot in advance for your support!
Thanks a lot! I installed java 32-bit and 64-bit versions the way it is recommended here: https://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/ and I installed the rJava package like this: install.packages("rJava")
library(rJava) and here: https://askubuntu.com/questions/176115/what-is-the-best-way-of-installing-the-r-package-xlconnect I found that this here should work to register R correctly: sudo R CMD javareconf but then I get the error that the console got an unexpected symbol. Or Do you know how to register Java Development Kit in R correctly. I installed jdk-8u161-windows-x64.
Make sure you have Java Development Kit installed and correctly registered in R.
I am using R studio 0.97 along with R version 3.1.2. I keep getting the following issue:
Warning in install.packages:
unable to move temporary installation '...\My Documents\R\win-library\3.1\file14984b915ea3\shiny' to '...\My Documents\R\win-library\3.1\shiny'
I have already tried installing Shiny package with same version R in another system and it installed perfectly.
Any specific thing that I should know of? Please suggest any fix for this.
I am working on a Windows 7 machine without internet access. As yet, I got around the missing internet connection by creating a local copy of the binary CRAN repository in //server/x/bin/windows/contrib/3.1, then running write_PACKAGES("//server/x/bin/windows/contrib/3.1") and finally setting r["CRAN"]="file:////server/x";r["CRANextra"]=r["CRAN"]; in C:/Program Files/R/R-3.1.2/etc/Rprofile.site.
But this does not work any longer since R 3.2.1. The path in the error message of install.packages indicates that R is looking for the source package:
Cannot open compressed file '//server/x/src/contrib/PACKAGES'
I have thought that R on Windows only looks for binary packages!
Looking at a diff between install.packages for 3.1.2 and 3.2.1, I can see quite a few changes. However, the source code for the function has 500+ lines which makes it hard for me to see where specifically the problem lies.
I have tried to set
options(install.packages.check.source="no")
and to explicitly add type="win.binary" to install.packages - both without success.
It is also interesting that
contrib.url(options("repos")$repos["CRAN"],type="win.binary")
gives the correct path file:////server/x/bin/windows/contrib/3.2 but somehow this is not used by install.packages(...,type="win.binary")...
So my question is whether you guys have experienced similar problems?
If no, I would be grateful for any pointers to mistakes I could have made.
I have found the problem.
The R 3.2.1 NEWS section (https://cran.r-project.org/src/base/NEWS) says
The default for option pkgType on platforms using binary packages is now "both", so source packages will be tried if binary versions
are not available or not up to date.
The problem is that RStudio does not directly call install.packages but via a few other functions such as .rs.callAs. In one of these functions, available.packages() gets called without any arguments. So it determines the argument type via getOption("pkgType"). But since R 3.2.1 this is now "both" and not "win.binary" as in R 3.1.2.
A quick workaround for the problem is thus to add
options(pkgType="win.binary")
to the yourRinstallpath/etc/Rprofile.site
I have made a shiny app which works fine on windows, but when I tried running the same on my ubuntu system the app exists abruptly and I get following error
Loading required package: TTR
Version 0.4-0 included new data defaults. See ?getSymbols.
Error in library(rstudio) : there is no package called ‘rstudio’
After this I tried installing the 'rstudio' package and I am getting the following message:
Warning in install.packages :
package ‘rstudio’ is not available (for R version 3.2.1)
My R version is: 3.2.1 and my RStudio version is: 0.99.467
Note: I am new to ubuntu and the only reason I shifted to ubuntu, was to to use shiny-server.
The rstudio package comes with the installation of RStudio (Desktop or Server). If you need to use the rstudio package, you probably need to install RStudio (Dekstop or Server version).
You can do that from here:
https://www.rstudio.com/products/rstudio/download-server/
That said, I'm not clear on why you would need to load the rstudio package.
That is because there is no package called rstudio (at least not on CRAN anyways). Either there is a typo and you really meant the rstudioapi package, or on your windows system you actually did install a package named rstudio that, however, was distributed from another source other than CRAN. I'd suggest try removing the line library(rstudio) and see if it works.