R error - cannot find function in installed package - r

I am trying to run a oneway whelch Anova in R using the package userfriendlyscience. Below are my steps:
install the package using the following command
install.packages("userfriendlyscience")
direct R to the package library using library(userfriendlyscience).
run the oneway test using the command:
one.way <- oneway(data$group, y = data$Volume, posthoc = 'games-howell')
However, I get the following errors:
When I direct R to the package:
Error: package or namespace load failed for ‘userfriendlyscience’ in
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]): there is no package called ‘psych’ In addition: Warning
message: package ‘userfriendlyscience’ was built under R version 3.5.3
when I run the oneway test:
Error in oneway(data$group, y = data$Volume, posthoc = "games-howell")
: could not find function "oneway"
I am using R version 3.5.2 - could this be the problem? and if so is there a work around or should I download a newer version of R?
Thanks

Related

tbl_regression from package gtsummary

install.packages("gtsummary")
library(gtsummary)
Error: package or namespace load failed for ‘gtsummary’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘glue’ 1.4.2 is already loaded, but >= 1.6.0 is required
I am trying to use the function tbl_regression but every time I type library(gtsummary), I get this message and a failure. How can I solve this problem?

Installing caret package in R

When I tried to load package of "caret" for my logistic regression model in R, the error message says "package or namespace load failed for ‘caret’.....". Is it an issue of my R version? I have 1.1.456 version.
install.packages("caret")
library(caret)
crossValSettings <- trainControl(method = "repeatedcv", number = 10,savePredictions = TRUE)

Can't Load statnet in R on Windows 10

I have run
install.packages('statnet')
library('statnet')
Result:
Loading required package: tergm
Loading required package: ergm
Error: package or namespace load failed for ‘ergm’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘statnet.common’
Error: package ‘ergm’ could not be loaded
In addition: Warning messages:
1: package ‘statnet’ was built under R version 3.4.4
2: package ‘tergm’ was built under R version 3.4.4
Error: package ‘ergm’ could not be loaded
5.
stop(gettextf("package %s could not be loaded", sQuote(pkg)),
call. = FALSE, domain = NA)
4.
.getRequiredPackages2(pkgInfo, quietly = quietly)
3.
library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc,
quietly = quietly)
2.
.getRequiredPackages2(pkgInfo, quietly = quietly)
1.
library(statnet)
Next I tried
install.packages('ergm') # Worked with warning: dependency ‘statnet.common’ is not available
But library(statnet) still does not work, and library(ergm) has a similar error message.
Also tried install.packages(statnet.common) but also get
package ‘statnet.common’ is not available
I'm running RStudio Version 1.1.419, with R version 3.4.3 on Windows 10
Any ideas how to load statnet in R?
Updating my version of R to 3.5.3 solved my problem.

>library(Rcmdr) #fails to load

I have tried the following steps:
install.packages("Rcmdr", dependencies=TRUE)
install.packages("knitr", dependencies=TRUE)
library(Rcmdr)
output for this step is below
Loading required package: RcmdrMisc
Error: package or namespace load failed for ‘RcmdrMisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘knitr’
Error: package ‘RcmdrMisc’ could not be loaded
I'm working in Rversion=3.4.1 & Rstudio=1.0.143

After I installed car package, I can not load Salaries data set

> r#quire(car) # Salaries 데이타을 사용을 위해
필요한 패키지를 로딩중입니다: car
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
네임스페이스 ‘pbkrtest’ 0.4-2는 로드되었으나 >= 0.4.4가 필요합니다
In addition: Warning message:
패키지 ‘car’는 R 버전 3.2.5에서 작성되었습니다
> library(car)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
네임스페이스 ‘pbkrtest’ 0.4-2는 로드되었으나 >= 0.4.4가 필요합니다
In addition: Warning message:
패키지 ‘car’는 R 버전 3.2.5에서 작성되었습니다
Error: package or namespace load failed for ‘car’
> str(Salaries)
Error in str(Salaries) : object 'Salaries' not found
A car package is the default one it already installed when I install r. I tried to download and include it. But It still got the error that it can not find the Salaries data set that included in car package. What is the problem? Sorry for the Korean message. If you let me know to change message in English, I will retry and reupload the message. Below is my console
UPDATE
I updated this error message in English and tried running the comment's one. But still it is not working.
> install.packages("car", dependencies=TRUE)
Warning in install.packages :
dependency ‘pbkrtest’ is not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447199 bytes (1.4 MB)
downloaded 1.4 MB
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Windows\Temp\Rtmpgr6B80\downloaded_packages
> library(car)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘pbkrtest’ 0.4-2 is being loaded, but >= 0.4.4 is required
In addition: Warning message:
package ‘car’ was built under R version 3.2.5
Error: package or namespace load failed for ‘car’
> str(Salaries)
Error in str(Salaries) : object 'Salaries' not found
It solved with update r version up to 3.3.2. pbkrtest needs r version to be more than 3.3.2 (newest version). I updated r and reinstall pbkrtest and then car package.
Salaries data set is currently available under [carData package], I solved as the following
install.packages("carData")
data("Salaries", package="carData")
sample_n(Salaries,3)
rank discipline yrs.since.phd yrs.service sex salary
1 Prof B 26 19 Male 193000
2 AssocProf A 13 8 Male 78182
3 AsstProf B 4 3 Male 91000

Resources