开发者

How to implement Theil–Sen estimator in R?

I would like to use Theil–Sen estimator in R, I found the package http://cran.r-project.org/web/packages/zyp/zyp.pdf but i get an error ins开发者_运维百科talling it using:

install.packages(zyp)


> install.packages(zyp)
Errore in install.packages(zyp) : oggetto "zyp" non trovato

It just telling me that there is no zyp package, I can't install it.

Do you know other libraries with this method?

Thank you


This is pretty trivial, but you just need quotation marks around "zyp":

install.packages("zyp")

In your defense, R is not always consistent about whether quotation marks are required: for example library() can take either quoted or un-quoted input; save() requires the name of the object to save; object.size() requires the object itself ...

To help you with future interpretation of error messages:

oggetto "zyp" non trovato

(or 'object "zyp" not found') means R couldn't find an R object in the workspace called zyp. The error message you would have gotten if you had tried to install a non-existent package would be (a suitable translation of):

> install.packages("junk")
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘junk’ is not available (for R version 2.13.0 alpha)

PS you might want to consider rephrasing/retitling your question, as it really has nothing to do with the Theil-Sen estimator ... just with installing packages in R


I suspect most fully stocked repositories have it. I just check the CMU repo at: http://lib.stat.cmu.edu/R/CRAN and version 0.9-1 is there. There are often hours on Sundays when maintenance is being done and generally just switching to another repository will solve the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜