cran

R help page as object

穿精又带淫゛_ 提交于 2019-11-27 02:09:58
Is there a nice way to extract get the R-help page from an installed package in the form of an R object (e.g a list). I would like to expose help pages in the form of standardized JSON or XML schemas. However getting the R-help info from the DB is harder than I thought. I hacked together a while ago to get the HTML of an R help manual page. However I would rather have a general R object that contains this information, that I can render to JSON/XML/HTML, etc. I looked into the helpr package from Hadley, but this seems to be a bit of overkill for my purpose. Edited with suggestion of Hadley You

NOTE in R CRAN Check: No repository set, so cyclic dependency check skipped

时光总嘲笑我的痴心妄想 提交于 2019-11-27 01:28:45
问题 As of R 3.1.0 I get the following R check: * checking package dependencies ... NOTE No repository set, so cyclic dependency check skipped I tried this advice: https://twitter.com/phylorich/status/431911660698083328 No go. I put the line options(repos="http://cran.rstudio.com/") in a .Rprofile in the package root directory. Still get the Note. Also section 1.3.1 of Writing R Extensions states: Some Windows users may need to set environment variable R_WIN_NO_JUNCTIONS to a non-empty value. The

Update a specific R package and its dependencies

馋奶兔 提交于 2019-11-27 01:15:17
问题 I have around 4000 R packages installed in my system (a server) and most of them are outdated because they were built before R-3.0.0. Now I know update.packages(checkBuilt=TRUE, ask=FALSE) would update all my packages but that's too slow. The thing is the users do not use most of the packages and now and then they ask me to update a package (say fields) they'd use. Now if I run install.packages("fields") it would only update the package fields but not the package maps even if fields depends

list all functions on CRAN

纵然是瞬间 提交于 2019-11-26 21:53:12
问题 Suppose I'm trying to run a script of unknown origin, and one of the functions is from a package that is not loaded by the script (an oversight, maybe it was loaded in the .Rprofile of the person who wrote it). How can I find in which package this function resides? There's some information compiled on CRAN, that doesn't require the user to download/install all R packages locally; however as far as I could tell it only gives access to the DESCRIPTION files. RSiteSearch, and its web equivalent,

Using a static (prebuilt) PDF vignette in R package

可紊 提交于 2019-11-26 20:55:45
问题 What is the proper way, to include a static PDF file as a "vignette" in a CRAN package as of R 3.0? The trick described in this document of using an empty stub Rnw does not seem to work in R 3.0. The document suggests that there is now a better way based on \VignetteEngine{} but it's not quite clear how this works for static PDF files. 回答1: With R.rsp (>= 1.19.0) you can include a static PDF 'vignettes/main.pdf' by adding a tiny 'vignettes/main.pdf.asis' text file that contains: %

Cluster one-dimensional data optimally? [closed]

为君一笑 提交于 2019-11-26 20:30:52
Does anyone have a paper that explains how the Ckmeans.1d.dp algorithm works? Or: what is the most optimal way to do k-means clustering in one-dimension? Univariate k-means clustering can be solved in O(kn) time (on already sorted input) based on theoretical results on Monge matrices, but the approach was not popular most likely due to numerical instability and also perhaps coding challenges. A better option is an O(knlgn) method that is now implemented in Ckmeans.1d.dp version 3.4.6. This implementation is as fast as heuristic k-means but offers guaranteed optimality, orders of magnitude

Package dependencies when installing from source in R

99封情书 提交于 2019-11-26 20:24:32
问题 Just confirming: If I distribute my R package as ZIP/TAR then installing the package will not automatically download/install dependencies because I have to set repos = NULL in install.packages() and dependencies parameter is not used if repos = NULL ? The way to possibly get this to work is to package an install script. Is that possible? Am I completely missing something here and there is a mechanism to install from source AND automagically download and install dependencies? 回答1: You could

Error “.onLoad failed in loadNamespace() for 'tcltk'”

情到浓时终转凉″ 提交于 2019-11-26 17:59:13
I have a general question about how to effectively load any kind of external package into R. I have found that many sources detailing this information are simply insufficient, but I will leave out mentioning those respective URLs. I have successfully loaded external packages into R before, but I am having difficulties loading the fgui package. In my specific case, I cannot load the library fgui into R Studio. First I download directly from CRAN with the command: install.packages("fgui", lib="~/Documents/R_dir") This works fine for me. My working directory is set to ~/Documents/R_dir The next

R: apt-get install r-cran-foo vs. install.packages(“foo”)

让人想犯罪 __ 提交于 2019-11-26 15:36:06
问题 When installing R packages (say mcmcpack in this example) under Ubuntu I have the choice between the following two methods of installation: # Let the distribution's packaging system take care of installation/upgrades apt-get install r-cran-mcmcpack # Let R take care of installation/upgrades install.packages("mcmcpack") Questions: Is any of the two ways of installing R packages considered "best practice"? Assume that I first install.packages("mcmcpack") and later on apt-get install r-cran

R help page as object

两盒软妹~` 提交于 2019-11-26 09:59:20
问题 Is there a nice way to extract get the R-help page from an installed package in the form of an R object (e.g a list). I would like to expose help pages in the form of standardized JSON or XML schemas. However getting the R-help info from the DB is harder than I thought. I hacked together a while ago to get the HTML of an R help manual page. However I would rather have a general R object that contains this information, that I can render to JSON/XML/HTML, etc. I looked into the helpr package