Problem in Rstudio installing a package from Github

I´m trying to install the package "musto101/wilcox_R" in RStudio 1.4.1103 because I need some functions with robust methods that are only there. I´ve tried in many ways, with code, from zip-open option, etc.

Nevertheless, I always obtain the same error (also in R):
Failed to install 'anRpackage' from GitHub

a) The entrance information
install.packages("remotes")
remotes::install_github("musto101/wilcox_R")

b) The exit information:
√ checking for file 'C:\Users\Daniel\AppData\Local\Temp\Rtmp6xgLCZ\remotes19dc7d053c\musto101-wilcox_R-3a25e4a/DESCRIPTION' (343ms)
preparing 'anRpackage': (7.8s)
√ checking DESCRIPTION meta-information ...
installing the package to process help pages (5.9s)
installing source package 'anRpackage' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Note: possible error in 'indt(x, y, tr = tr, nboot = nboot, ': unused arguments (tr = tr, alpha = alpha)
Note: possible error in 'disc2com(x[[j]], x[[k]], ': unused arguments (SEED = FALSE, nboot = nboot)
Note: possible error in 'indt(x[, j], x[, jj], ': unused argument (tr = tr)
Note: possible error in 'indt(x[, j], y, tr = tr, ': unused argument (tr = tr)
Note: possible error in 'fdepthv2(y, x, plotit = FALSE, ': unused argument (cop = cop)
Note: possible error in 'fdepthv2(x, y, plotit = FALSE, ': unused argument (cop = cop)
Note: possible error in 'pdis(temp2, pr = FALSE, ': unused argument (pr = FALSE)
Note: possible error in 'pdisMC(temp2, pr = FALSE, ': unused argument (pr = FALSE)
Note: ... may be used in an incorrect context
Note: possible error in 'indt(x, res, flag = flag, ': unused arguments (alpha = alpha, tr = tr)
Note: possible error in 'pdisMC(bcon, center = tvec, ': unused argument (na.rm = FALSE)
Note: ... may be used in an incorrect context
** help
Warning: C:/Users/Daniel/AppData/Local/Temp/RtmpM7zW04/Rbuild141440425ce2/anRpackage/man/anRpackage-package.Rd:26: All text must be in a section
Warning: C:/Users/Daniel/AppData/Local/Temp/RtmpM7zW04/Rbuild141440425ce2/anRpackage/man/anRpackage-package.Rd:27: All text must be in a section
*** installing help indices
Error in Rd_info(db[[i]]) :
missing/empty \title field in 'C:/Users/Daniel/AppData/Local/Temp/RtmpM7zW04/Rbuild141440425ce2/anRpackage/man/Aband.Rd'
Rd files must have a non-empty \title.
See chapter 'Writing R documentation' in manual 'Writing R Extensions'.
removing 'C:/Users/Daniel/AppData/Local/Temp/RtmpM7zW04/Rinst14147b2d5f23/anRpackage'

The link of the package: https://github.com/musto101/wilcox_R

Maybe the package doesn´t work properly or maybe I´m doing something wrong. I only need certain functions, so if I could only take them it´d be ok for me anyway (I don´t know if it´s possible, I´m new with Rstudio).

Hope you can help me, I need it for an exam! Thanks in advance.

Do you have devtools installed?

Here is a link to the janitor package showing how to install from GitHub that may help.

1 Like

Ok, thanks for you help and the information about packages. I tried the function:
sapply(list.files("/<C:\Users\Daniel\Downloads>\R/"))

An then this error appeared:
Error: '\U' used without hex digits in character string starting ""/<C:\U"

I looked for information about it and I tried to change all the oblique bars for doubles.
sapply(list.files("\\<C:\\Users\\Daniel\\Downloads>\\R\\"))

Then another error came:
Error in match.fun(FUN). The argument is missing.

WR2 is a nice option but other functions like "bireg" for the biweight midregresssion estimator are only on Wilcox_R.

Maybe I´m missing something. I hope you can help me.

You need to replace <path to wilcox_R> (including the < and >) with the full path to where you downloaded the R files. R uses forward slashes (/) for paths, even on Windows. So it will look like this:

sapply(list.files("C:/Users/Daniel/Downloads/R/")

Or this:

sapply(list.files("C:/Users/Daniel/Downloads/Wilcox_R/R/"))

By the way the version on Rand Wilcox's website does include bireg(), so you might be better off using that. There are also instructions on how to load the functions on that page.

1 Like

I´ve tried those two codes and the error persists:
Error in match.fun(FUN). The argument is missing.

I didn´t want to bother you more with that error (it seems this package needs a lot of work), so I tried the other solution that you have provided to me (Rand Wilcox´s website). I´ve followed the steps from there and I could without any problems to install WRS updated and get all the "strange" robust functions I needed plus others. Thank you so much for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

You're not doing anything wrong, the package just doesn't build. The error you're getting comes from the first function (Aband.R), but it looks like none of the (1200+) functions in that repository have properly formatted documentation so fixing it would take a great deal of time.

When you find R packages on GitHub it's important to bear in mind that, unlike CRAN, there is no quality control and the code there isn't guaranteed to work. A repository could contain a tested, usable package; a package still in development that isn't recommended for wider use yet; or, as looks to be the case here, a project someone started developing but abandoned. You should always look at the README file for instructions or clues about the development status before trying to install it.

If you really need to use the functions in this package, you could download its source code from GitHub, unzip it, and run sapply(list.files("/<path to wilcox_R>/R/")). This will run all the files in that directory and make the functions they define available to you. Though if I understand correctly, they were all originally written by Rand Wilcox, and the canonical distribution is available as an R source file on his website or in the CRAN package WRS2.

2 Likes

Thanks. Yes, I already installed devtools.