r package installed properly but "there is no package called ‘DiabetesTxPath-master" error - r

I'm trying to install a package called "DiabetesTxPath-master" from local files.(The file can be downloaded in https://github.com/rohit43/DiabetesTxPath)
I used the code below installing it.
'filename<-"DiabetesTxPath-master.zip"'
install.packages(filename,type="binary",repos=NULL)
but when I try to load the packaged by the code below,
library(DiabetesTxPath)
error comes up.
there is no package called ‘DiabetesTxPath-master'
There is no problem in location.
.libPaths()
[1] "C:/Program Files/R/R-3.4.2/library"'
and this is where I want my package to be installed.
(and I see my packaged installed in the folder with my eyes!)
2.I've also tried to run as an administrator. it didn't work either.
So what could be the probelm, and how could I fix this?
Any comment would be appreciated so much.
I've been trying it so hard for a week.

Try using
library(devtools)
install_github("rohit43/DiabetesTxPath")
the problem arises because the dependencies for this package
ERROR: dependencies 'FeatureExtraction', 'CohortMethod',
'OhdsiSharing' are not available for package 'DiabetesTxPath'
are not available for this package in R 3.5 and above .
Now you need to install older version of R where these dependencies were supported and try using the above method.

Related

R Package Dependency in Github via Remotes not working

I'm developing an R package in Github (ConceptionTools) that depends on another R package (CreateFlowChart), also in Github. I have followed the instructions for defining remote dependencies. My DESCRIPTION file includes:
Imports: CreateFlowChart
Remotes: github::IMI-ConcePTION/CreateFlowChart
However, when I install my package, with the command:
devtools::install_github("IMI-ConcePTION/ConceptionTools")
This dependency is not installed. I simply get "skipping 1 packages not available: CreateFlowChart". It doesn't appear to be trying to use the Remote, since there is no error related to Github.
When I install the dependency directly, that works:
devtools::install_github("IMI-ConcePTION/CreateFlowChart")
Does anybody have any idea of what could be going on here? I'm racking my brain, as it seems to be a quite straightforward case of what the documentation shows. I'm using R 4.0.3 (on Windows 10) and devtools 2.3.2.
There was a typo in the name of the dependency package in its DESCRIPTION file.
This does not make the package fail when installing it directly, but it leads devtools not to find it as a dependency.

How to install MVPARTwrap package in R version 3.6.1?

I am trying to install mvpart and MVPARTwrap packages in R version 3.6.1.
I install on my PC the folder of these two packages in zip version and load them in the relative folder of the package.
When I run the script library(mvpart) I get this message:
ERROR: 'mvpart' package was built before R 3.0.0: please reinstall it."
I try to load this library in the old version of R (version 2.15) and the message is
in install.packages (mvpart): object 'mvpart' not found".
I do not understand why it is impossible to load this package. Thanks so much.
Maybe the answer is no more relevant, but I just had to install those libraries so maybe it will still help someone later. I suggest the install from github as it will install dependencies, you need however to be able to compile the source. So here we go :
first install rtools if it is not already installed go here and follow the instruction
update/install devtools if necessary as described here
using this command, it should work now. you may be asked to update some packages, accept all
devtools::install_github("cran/mvpart")

Installing local binary packages using R CMD INSTALL on a Mac

I came across a package that is not available on CRAN. I tried to install the package using:
Packages & Data > Package Installer > Local Binary Package > At User
Level > [FileName.tgz] > Install...
This didn't work and I am now trying to use the R CMD INSTALL command. However, it seems I need to run that command in the command line interface but I cannot get it to install properly.
The package I'm trying to install is called gEcon. It can be found here. In particular, I am getting the following error message after "installing" the package:
Error: package or namespace load failed for ‘gEcon’:
package ‘gEcon’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
I assume it's the way I'm installing it.
Thanks in advance.
You're going to need to install Xcode apparently, because you've got to install this from source per these directions:
Now, you've gotta update R to the latest stable release, or if you prefer you can find the exact minimum newest version needed for gEcon.
After upgrading R you can complete the installation from source.
Original answer to original question:
Two things:
To access the command line and use R CMD on an Apple computer, please use the terminal.app app. Please see this for more details.
An easier and probably better approach is to install your package from the author's Github (or BitBucket, etc) repository using devtools::install_github or just use devtools::install on the downloaded source project.

Error while installing R package: package built for universal-apple-darwin

I installed a R package as suggested by How do I install an R package from source?, using R CMD INSTALL [my_pkg_path.tgz]. Package sources are downloaded from r-project.org, e.g., http://cran.r-project.org/web/packages/fields/index.html
However, when I try to load the package using say library(fields), I got the error that complains the package are built for universal-apple-darwin:
Error: package ‘fields’ was built for universal-apple-darwin9.8.0
Guess it's something to do with architecture, but no idea how to resolve it. Any idea? Thanks.
It looks like you downloaded the package's Mac OSX binary file, which usually ends in .tgz - try downloading the package source (usually something ending in .tar.gz) and installing the package again.
Depending on what your operating system is, you may need an additional set of software before you can install packages from source. If the above suggestion doesn't work, would you provide some information about the OS, for example from sessionInfo()?

problem when installing RTextTools for R

I was trying to install RTextTools package for R, but failed. Here is the output from the screen
> > install.packages("RTextTools")
Warning in install.packages("RTextTools") :
argument 'lib' is missing: using 'C:\Users\datamining\Documents/R/win-library/2.10'
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.10
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RTextTools’ is not available
What's the reason for this problem, and how to fix it? Thanks.
There are two distinct, but related, issues:
You are running version 2.10 of R which is two years old. CRAN supports only the current version with pre-built binaries. You could try installing from source.
RTextTools, as can be seen on its CRAN page also requires at least R version 2.13.
So in short: you should upgrade.
I have resolved the issue. I have Download RTextTools From Given Link.

https://cran.r-project.org/src/contrib/Archive/RTextTools/
and copy RTextTools_1.4.2.tar.gz file in project root folder then run this command in project folder in terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
After running this command I receive below error
"ERROR: dependencies ‘SparseM’, ‘randomForest’, ‘tree’, ‘e1071’, ‘ipred’, ‘caTools’, ‘maxent’, ‘glmnet’, ‘tau’ are not available for package ‘RTextTools’".
Now install each dependencies from RStudio or RConsole (Any Editor used by you) by simply running this code.
install.packages("caTools").
Install all 9 required packages One By One (In My Case it was 9 Packages Dependencies required by RTextTools) all packages will be installed except 'maxent'.
Now download maxent from the given link.
https://cran.r-project.org/src/contrib/Archive/maxent/.
and copy maxent_1.3.3.1.tar file in project folder then run this command in project folder in terminal.
"R CMD INSTALL maxent_1.3.3.1.tar"
Now For RTextTools Run this command again in Terminal.
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
All is done Now..
But the Last Step is
Load the RTextTools using.
library(RTextTools)
You will see one more Error: Load SparseM Now Loading SparseM use code below.
library(SparseM)
and in the last Load RTextTools
library(RTextTools)
RTextTools is dependent on a number of packages, most of which require R 2.13+. You should always keep R updated to the latest version, since each update contains numerous bug fixes and performance enhancements.
If you can't install packages from repository or the packages are not available anymore, just follow this steps:
Install.packages("devtools")
check -- library("devtools")
install_github("cran/maxent")
install_github("cran/RTextTools")

Resources