can't use sjPlot in R - r

I followed the instructions on https://strengejacke.github.io/sjPlot/ to install the package but despite downloading and installing all the packages, I can't use them because I keep getting the error message
could not find function "sjP.lmer"
does anyone know where this is coming from? I'd be happy to provide more details but I don't even know where to look for them...

Related

Install LiDAR Terrestrial Point Cloud Processing of Forest Data package does work

I try install TreeLS package, but i receive this message.
install.packages("TreeLS")
Message:
Installing package into ‘C:/Users/Matheus Pacheco/AppData/Local/R/win-library/4.2’
Warning in install.packages :
package ‘TreeLS’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
I found that the package is not present in CRAN anymore, and i try install from source, using:
install.packages("TreeLS", repos = "https://cran.r-project.org/src/contrib/Archive/TreeLS/TreeLS_2.0.2.tar.gz", repo = NULL, type="source")
But, some functions in the package, doesn't work.
I would be grateful if someone can help me. My final paper in PhD depends on it.
Thanks!
I'm afraid that if you're using a retired package, there is little help to get unless you try to fix it yourself. The question become too general.
But, some functions in the package, doesn't work.
Contact package developer, there is probably another package that include what you need, or his code might have been moved into some other package. He/She would know.
Perhaps someone can help you if you pull out the parts you need.
last resort (not recommend), downgrade to a compatible R version.

Error message for installing package "ggRandomForests" in R

I am a beginner in R, so maybe the solution is obvious (if so, I am sorry). I tried to install the package "ggRandomForests" in R (Version: 4.1.2) and I got this message:
Warning in install.packages :
package ‘ggRandomForests’ is not available for this version of R
I googled the problem and found some solutions that I tried but they didn't work:
I tried installing "ggRandomForest" since someone suggested that but that gives the same error message.
I also tried taking an older version of ggRandomForests from this website: https://cran.r-project.org/src/contrib/Archive/randomForest/, stored the URL in a variable and tried to install it like that, but that also didn't work (no error message, just nothing happens). This was my code for that:
urlPackage <- "https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz"
install.packages(urlPackage, repos=NULL, type="source")
Maybe I am missing something or does someone know what the problem is?
Specifically I want to use gg_vimp(), so maybe someone knows an alternative?

"package or namespace load failed" error in loading R package from GitHub

I am trying to load a package in RStudio from GitHub but I get an error.
I have also updated all the packages in order to see if this was the problem but I still get the same error. I have a MAC pc (I don't know if this may cause some problems).
The link of the package that I would like to load is:
https://github.com/andrewraim/COMMultReg
and there is written that in order to load it I need to run
library(devtools)
install_github("andrewraim/COMMultReg")
But when I run the second line I get as error:
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘COMMultReg’ in namespaceExport(ns, exports):
undefined exports: d_cmb, d_cmb_sample, d_cmm, d_cmm_sample, gunterize, loglik_score_fim_cmm, normconst_cmb, normconst_cmm, r_cmb
Errore: loading failed
Esecuzione interrotta
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/COMMultReg’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/n0/4lmr1lrj7qqfylmh6s8qx0nr0000gn/T//RtmpldrmHr/file72e1e4469d/COMMultReg_0.1.0.tar.gz’ had non-zero exit status
Can somebody help me telling me what to do?
Thanks!!
The package has no function named d_cmb, but it tries to export that function. That's what the error message says, and it's true.
I think the reason for this error is that the author used Roxygen2 to generate his NAMESPACE file where the exports are declared, but that file is out of sync with the contents of the package.
It's possible this happened because the author forgot to commit a new file containing the new code. In that case, the best solution is to contact the author, and point out the issue.
Alternatively, it may have happened because at one time there was a d_cmb function, but the author removed it, without updating the NAMESPACE file. This one you might be able to fix yourself.
To fix this, you'll need to run Roxygen2 yourself, which is a little more complicated than just installing what's on Github. Here are the steps:
Fork the package to your own Github account if you have one. (This step is optional, but it makes some later steps easier.)
Download the source for the package. In RStudio, the quickest way to do this is to create a new project using Version Control, Git, and give the URL
of your forked copy, or the original URL if you skipped that.
Run Roxygen2 on the package. In RStudio, you do this by choosing "Document" in the "More" menu of the Build tab.
Try to build it. If you're lucky, it will now build properly. If not, fix the next problem.
This is very important: send your changes back to the original author. If you forked the package, this is easy; if not, figure out a way to do it.
this is the maintainer of the COMMultReg package. I didn't know about this thread until now, but it sounds like you were able to get started from the answer by user2554330.
The functions d_cmb, d_cmb_sample, etc are supposed to be exported. I think the problem may have been that, at the time of the question, I did not have src/RcppExports.cpp and R/RcppExports.R checked into Github. This seems to be necessary to use install_github on a package with exported Rcpp functions. Those were checked in around 8 months ago. (Coincidentally not long after this question was posted?)
Please let me know if you still having trouble with the install. Otherwise, enjoy the package!

browseVignettes not returning anything for ggplot2 package in R - No error message

I'm very new to R and recently installed R-studio. I'm trying to familiarize myself with packages by using browseVignettes() but it isn't returning anything for the package ggplot2, which I know contains vignettes from a tutorial video.
When I try using browseVignettes with certain packages in the system library, I receive an error message, e.g.:
> browseVignettes("stats")
No vignettes found by browseVignettes("stats")
By contrast, I receive no error message when attempting to access the vignettes of ggplot2.
My theory is that I installed the package incorrectly. When I went through the installation, I received the below message.
> install.packages("ggplot2")
Installing package into ‘C:/Users/micha/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.0.zip'
Content type 'application/zip' length 4015425 bytes (3.8 MB)
downloaded 3.8 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\micha\AppData\Local\Temp\RtmpyYnCz3\downloaded_packages
Any assistance would be much appreciated, as I am hoping to be able to review these vignettes and avoid this error repeating itself next time I install a package from CRAN.
Welcome to R. There is a bit of a learning curve, but it is very powerful once you get the hang of it.
The installation of ggplot2 looks like it went according to plan. One way to check is to run library(ggplot2) in the console. If you do not get an error then it is installed correctly.
browseVignettes("ggplot2") should open a browser window with a list of the available vignettes (only 3 in this case). It does so silently, so that is why you did not get a message–error or otherwise.
Not all packages have vignettes, as you have already discovered with the "stats" package.
Incase anyone else comes across this looking for the answer...
Have you ever seen the term smart quotes as opposed to straight quotes...
it's the "" used in the original, they are smart quotes (curved). Delete them and re add them in R. Where ever they are being copied from they are not coming into R as straight quotes, thus they are not recognized.
Once they have been changed to straight quotes the command will run.
Hope this helps those coming after....

Trouble accessing help documentation for a package I created

I'm new to R so I hope this isn't incredibly obvious. I created a package that contains two functions. I provided documentation using roxygen2 for each of the functions, documented and built the package as well as installed and restarted multiple times. I also pushed it up to github and have done everything I can think of to do, yet I cannot access the help files that I created. I always receive this error:
No documentation for ‘myfunc’ in specified packages and libraries: you
could try ‘??myfunc’
Not only is ?myfunc not working, but when I attempt to install my own package to my own RStudio console, but I also receive this error:
Warning in install.packages : package ‘yourpackage*’ is not
available (for R version 3.6.1)
What exactly is going wrong here, and how can I attempt to fix it? I've built packages before and this time I've followed all the same steps I've been taught to use and have used in the past, but for some reason, I'm being met with these errors. I would appreciate any and all help you all have to offer. Thank you in advance!

Resources