Autospearman in R - r

Did anyone used the AutoSpearman function from "software-analytics/Rnalytica" package and worked for him? I keep having errors while loading the package. You can find here the documentation of AutoSpearman function.

Related

could not find function "some Function" from some package

I am encountering an error when creating a data frame. I was running some package one day back everything was good but now I am having some issues like not able to find some function. I suspect its coz of my R studio (Ver. 1.2.5033). What do you think?
After loading some packages I can't access functions associated with them.
Best:
Imran
require(package)
could not find function "package's function"

Exporting function with snowfall

I am currently developing an R package and would like to make use of parallelization with the package snowfall. I'd like to call a function (actually an Rcpp wrapper if this matters) from the package itself, so the function is currently not floating around in the environment.
sfInit(parallel=TRUE,cpus=Cpu)
sfExport("RcppFunction")
sfLapply(1:N,function(cc) RccpFunction(args))
sfStop()
Anytime I try to do this I get the following error message:
Error in sfExport("RcppFunction") :
Unknown/unfound variable RcppFunction in export. (local=TRUE)
I already tried some tutorials and online handbook, but did not found yet the solution how to export any function to snowfall within a package. As far as I see it doesn't really have to do that this particular function is an RcppFunction. I hope someone can help! Thanks in advance!
PS: I already found this post, but I cannot export my own package to snowfall - at least this doesn't make sense to me.

Why can R not find function "getStates"

I am trying to create a character map and was recommended to use Phylotools and Ape packages in R.
I have installed the packages but when I try to do function getStates it comes up with an error message:
x<-getStates(nexdata,"tips")
Error in getStates(nexdata, "tips") : could not find function "getStates"
I have installed the right packages (so I think) and I am quite stuck. Any help would be really appreciated. If you need me to explain anything in more detail let me know.
The function library() loads and attaches add-on packages. You are using phytools and ape, so you should have in your code
library(phytools)
library(ape)
You can read more in the documentation, e.g. at rdocumentation.org/packages/base/versions/3.6.1/topics/library.

using betareg in coding with R

I am a beginner in R and I am supposed to make a model thanks to regression beta. I learned that I can use betareg() except that even when installing its package the R does not recognize it and displays me error:
Error: could not find function "betareg"
What could be the cause for that?
The error message you are getting typically arises when calling a function.
Before you can call a function, you have to install the package and load the library.
You can try this:
install.packages("betareg")
library(betareg)
and then call the function with relevant parameters
betareg()

How to properly use functions from other packages in a R package

I am a bit confused about this. I have an R package that has a small function (not a mayor part of the package) in which the principal function of the psych package is called. How do I correctly specify this in DESCRIPTION and NAMESPACE?
Setting Depends: psych in DESCRIPTION makes sure the psych package is loaded every time my package is loaded. This works, but it seems redundant for such a small part of my package.
Setting Suggests: psych and entering a require("psych") in the function is what I do now, however this does not work if psych is not installed, and seems to be the wrong way of doing this (writing R extensions says that suggest is meant mainly for examples).
I think I need to import the function. I tried setting Imports: psych in DESCRIPTION and importFrom(psych,"principal") in NAMESPACE. This works, but on a computer that does not has psych installed it gives an error when loading my package.
The basic question you need to answer is: "do you want the function to be available to all users of the package without further effort?". If yes, then use imports + the appropriate namespace declarations, if no, then use suggests and print an informative error message if require("psych") returns FALSE.
I don't understand your import related complaint that: "but on a computer that does not has psych installed it gives an error when loading my package". This is also true if your package is in depends!

Resources