R package not compatible with 3.5.3 - r

I am attempting to install a package that was made on my computer, but I am having issues. Installing seemed to work fine, but I got a warning:
Warning in install.packages :
package ‘abcmlr’ is not available (for R version 3.5.3)
This naturally throws the error when calling library
Error in library(abcmlr) : 'abcmlr' Not a valid package that has already been installed
Using .libPaths() returns "C:/Users/amlut/Documents/R/win-library/3.5" "C:/Program Files/R/R-3.5.3/library". So I presume this is why library() is giving me an error.
Why does installing my package not work for version 3.5.3 (Does this question require additional information about my package)? Is it possible to make my package work for 3.5.3? What steps would be required to achieve this?
Thank you.
Edit: this is a package I made, and I am using devtools::install
DESCRIPTION:
Package: abcmlr
Type: Package
Title: Analysis of Bone Counts by Maximum Likelihood
Version: 0.1.0
Author:
Maintainer:
Description: See Rogers ABCML for details
License:
Encoding: UTF-8
LazyData: true
NeedsCompilation: no
Packaged: 2019-06-14 21:17:42 UTC; amlut
Built: R 3.5.3; ; 2019-06-14 21:17:43 UTC; windows
Output from devtools::install:
devtools::install("C:/Users/amlut/Documents/R/win-library/3.5/abcmlr")
WARNING: Rtools is required to build R packages, but the version of Rtools previously installed in C:/Rtools has been deleted.
Please download and install Rtools 3.5 from http://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\amlut\Documents\R\win-library\3.5\abcmlr/DESCRIPTION' ...
- preparing 'abcmlr':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
Removed empty directory 'abcmlr/man'
- building 'abcmlr_0.1.0.tar.gz'
Running "C:/PROGRA~1/R/R-35~1.3/bin/x64/Rcmd.exe" INSTALL "C:\Users\amlut\AppData\Local\Temp\RtmpGySaDj/abcmlr_0.1.0.tar.gz" --install-tests
* installing to library 'C:/Users/amlut/Documents/R/win-library/3.5'
* installing *source* package 'abcmlr' ...
** R
** byte-compile and prepare package for lazy loading
No man pages found in package ** help
'abcmlr'
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (abcmlr)
In R CMD INSTALL
library(abcmlr)

Related

Cannot mannually install package in R

I am trying to install package using:
library(devtools)
install_github("s-conner/rmtl/rpackage")
However, I got error:
Error: Failed to install 'RMTL' from GitHub:
schannel: failed to receive handshake, SSL/TLS connection failed
Any advise, please?
It installs fine for me (on Linux). As the output shows, I also have a GITHUB_PAT but I do not think that should be required for a public repository.
$ installGithub.r s-conner/rmtl/rpackage
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo s-conner/rmtl#HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/remotes16a2746ead7197/s-conner-rmtl-c2fb188/rpackage/DESCRIPTION’ ...
─ preparing ‘rmtl’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Omitted ‘LazyData’ from DESCRIPTION
─ building ‘rmtl_0.0.0.9000.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘rmtl’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rmtl)
$
(where installGithub.r is a simple convenience wrapper for remotes::install_github from my littler CRAN package.)
So I guess you need to work out why the https handshake to GitHub fails for you. It would seem that GitHub serves the repository just fine.
you can also source the 3 functions in the package at the start of your code
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/cif.R")
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/rmtl.R")
devtools::source_url("https://raw.githubusercontent.com/s-conner/rmtl/master/rpackage/R/rmtl_mod.R")
You can also download the 3 r scripts files and source them
source("path/to/rmtl.R")

I can’t download the package BMR from github in R, it gives an error:

> library(devtools)
Download required package: usethis
Warning messages:
1: package ‘devtools' was built under R version 3.5.3
2: package ‘usethis’ was built under R version 3.5.3
> install_github("kthohr/BMR",force=TRUE)
Downloading GitHub repo kthohr/BMR#master
√ checking for file 'C:\Users\Asus\AppData\Local\Temp\RtmpqkzAt0\remotes4b403a3737ba\kthohr-BMR-63565cd/DESCRIPTION' ...
- preparing 'BMR': (3.1s)
√ checking DESCRIPTION meta-information ...
- cleaning src
- checking for LF line-endings in source and make files and shell scripts (1.1s)
- checking for empty or unneeded directories (362ms)
- looking to see if a 'data/datalist' file should be added
- building 'BMR_0.11.0.tar.gz'
Installing package into ‘C:/Users/Asus/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'BMR' ...
** libs
Ошибка: (конвертировано из предупреждения) this package has a non-empty 'configure.win' file,
so building only the main architecture
* removing 'C:/Users/Asus/Documents/R/win-library/3.5/BMR'
In R CMD INSTALL
Error: Failed to install 'BMR' from GitHub:
(converted from warning) installation of package ‘C:/Users/Asus/AppData/Local/Temp/RtmpqkzAt0/file4b4017187131/BMR_0.11.0.tar.gz’ had non-zero exit status
Try this:
install.packages("devtools")
library(devtools)
install_github("kthohr/BMR",force=TRUE)
Please install Rtolls direct its path on R. Then use the following codes.
install.packages("devtools")
library(devtools)
install_github("kthohr/BMR")
library(BMR)
find_rtools()
This to check if rtolls is installed.
If still not working please reinstall R, Rstudio and Rtools then again try running it. It worked in my case.
To check if the package is installed try opening on of the data sets included in the package.
data(BMRMCData)

R - devtools - Build - ZIP failure?

I have been trying to build a package in R using the package devtools and the build function but it keeps failing on the zip element despite having the zip package installed?
* installing to library
'C:/Users/OMICRON/AppData/Local/Temp/Rtmpc30Top/temp_libpath133c19a632ea'
* installing *source* package 'simTools' ...
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'simTools'
finding HTML links ... done
sampleFromData html
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* MD5 sums
Warning in system(paste(shQuote(ZIP), "-r9Xq", filepath, paste(curPkg,
collapse = " "))) :
'"zip"' not found
running 'zip' failed
* DONE (simTools)
In R CMD INSTALL
[1] "D:/R/simTools_0.0.0.9000.zip"
My guess is that zip is referring to the Linux zip command and not the zip package.
Do you have R-tools installed? That includes a number of Linux commands and is necessary for building packages on Windows. It also needs to be included to your PATH (System Properties -> Environment Variables). You can check if it is properly set up using devtools::find_rtools().

R-package missing functions, but has documentation

My problem is when i build a package using devtools, or R CMD INSTALL -build the package builds, but when I install the resulting .zip (when I've tried binary builds) or .tar.gz
the functions in the package don't show up. I can SEE the functions in the .tar.gz when I unzip and the files are sufficiently large so as not to empty. ANY help appreciated.
what I'm using: Rstudio, R v 3.1.0
>install.packages("E:/R/Rpackage_meadq/meadq_1.0.4.tar.gz", repos = NULL, type = "source")
'\\AA.AD.EPA.GOV\ORD\RTP\USERS\A-D\dhall05\Net MyDocuments'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'meadq' ...
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (meadq)
>installed.packages()
...
meadq "3.1.0"
> library('meadq')
>ls('package:meadq')
character(0)
## to take an example function within package
> create_ont_csv()
Error: could not find function "create_ont_csv"
>?create_ont_csv
this pulls up the function documentation for create_ont_csv that's in the package
when I look at the "meadq_1.0.4.tar.gz" using winzip, I can see all the functions.
I've tried building in binary and the same thing happens where the functions are missing, but the documentation is there.
I've tried re-building a lot with this code and also R CMD INSTALL -build ... :
> library('devtools')
Attaching package: ‘devtools’
The following objects are masked from ‘package:utils’:
?, help
The following object is masked from ‘package:base’:
system.file
> build("E:/R/Rpackage_meadq/meadq")
"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" --vanilla CMD build "E:\R\Rpackage_meadq\meadq" \
--no-manual --no-resave-data
* checking for file 'E:\R\Rpackage_meadq\meadq/DESCRIPTION' ... OK
* preparing 'meadq':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'meadq_1.0.4.tar.gz'
[1] "E:/R/Rpackage_meadq/meadq_1.0.4.tar.gz"

ERROR: a 'NAMESPACE' file is required

I am trying to install some R packages on a Linux machine using
R CMD INSTALL -l <ourRlibrarylocation> <path where I saved the packagename.tar.gz file>
and I see an error message:
ERROR: a 'NAMESPACE' file is required
I am using R 3.0.1. Please help, I am new to R and just downloaded these packages for customers.
One example:
R CMD INSTALL -l /abcde/R/R-3.0.0/library /home/RFILES/PKG/UScensus2000tract_0.03.tar.gz
* installing *source* package âUScensus2000tractâ ...
ERROR: a 'NAMESPACE' file is required
* removing â/abcde/R/R-3.0.0/library/UScensus2000tractâ
According to the R documentation for writing extensions, all packages destined for version 3.0.0 and later must contain a NAMESPACE file. If you download an R package that gives you the above error, here's what you should try:
Untar the package:
tar -xvf the_package.tar.gz
Add a NAMESPACE file with the line exportPattern( "." ):
cd the_package
echo 'exportPattern( "." )' > NAMESPACE
cd ..
Re-tar the package:
tar -zcf the_package.tar.gz the_package
Try and install it again.
Hope that helps.
I actually just hit the same thing when compiling R-3.0.1. It looks to be that the package version that I was using was out of date. This was for proto:
# /var/local/R-3.0.1/bin/R CMD INSTALL -l /var/local/R-3.0.1/lib64/R/library proto_0.3-9.2.tar.gz
* installing *source* package ‘proto’ ...
ERROR: a 'NAMESPACE' file is required
* removing ‘/var/local/R-3.0.1/lib64/R/library/proto’
But there was a newer version for proto (0.3-10) which worked fine:
# ../var/local/R-3.0.1/bin/R CMD INSTALL -l ../var/local/R-3.0.1/lib64/R/library proto_0.3-10.tar.gz
* installing *source* package ‘proto’ ...
** package ‘proto’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
‘proto.Rnw’
‘protoref.Rnw’
** testing if installed package can be loaded
* DONE (proto)
I had an older install of R (2.15), which the older proto package worked with:
# /var/local/R-2.15.0/bin/R CMD INSTALL -l /var/local/R-2.15.0/lib64/R/library proto_0.3-9.2.tar.gz
* installing *source* package 'proto' ...
** Creating default NAMESPACE file
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
'proto.Rnw'
'protoref.Rnw'
** testing if installed package can be loaded
It looks like the older version of R actually creates the missing NAMESPACE file, but the new version bails. Hope this helps you!
I found the following link more useful:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
6. The package is out of date
It may have been archived (if it is no longer maintained and no longer passes R CMD check tests).
In this case, you can load an old version of the package using install_version()
library(devtools)
install_version("foobarbaz", "0.1.2")
An alternative is to install from the github CRAN mirror.
library(devtools)
install_github("cran/foobarbaz")
One can now use remotes::install_url() or remotes::install_local().
It installs dependencies and generates the NAMESPACE file automatically.

Resources