Displaying 20 results from an estimated 5000 matches similar to: "packages: Examples with CPU or elapsed time > 10s"
2012 May 10
2
setting global options for a package
This may be elementary, but I can't find an answer: How can I set up
global options for
some specific arguments to functions in a package which can be easily
changed by the user?
This question relates to the selection of colors used in functions in
several packages (heplots,
genridge), where I want to provide reasonable default values for plots,
but allow users to
change those defaults
2011 Nov 24
3
How to deal with package conflicts
In my genridge package, I define a function ridge() for ridge
regression, creating objects of class 'ridge'
that I intend to enhance.
In a documentation example, I want to use some functions from the car
package. However, that package
requires survival, which also includes a ridge() function, for coxph
models. So, once I require(car)
my ridge() function is masked, which means I have to
2011 Oct 12
1
NOTE: unstated dependencies in examples
Using R 2.13.1, I am now getting the following NOTE when I run R CMD
check on my HistData
package
* checking for unstated dependencies in examples ... NOTE
'library' or 'require' calls not declared from:
gplots sp
Under R 2.12.x, I didn't get these notes.
I have ~ 25 .Rd files in this package, and AFAICS, every example uses
library or require for the
functions used;
2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10
colors, giving in each
column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The
rownames
identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are
ordered by columns
in the lower triangle of each distance matrix.
> helm.raw <-
2011 Aug 24
1
silently testing for data from another package for .Rd examples
In an .Rd example for a package, I want to use data from another
package, but avoid loading the entire
package and avoid errors/warnings if that other package is not available.
If I don't care about loading the other package, I can just do:
if (require("ElemStatLearn", quietly=TRUE)) {
data(prostate)
# rest of example
}
I'd rather just be able to do something like:
2010 Nov 25
1
Request: kronecker to get a sep= argument
kronecker, with make.dimnames=TRUE uses a hardwired sep=":" in the line
tmp <- outer(dnx[[i]], dny[[i]], FUN = "paste", sep = ":")
For an application in which dimnames arise from an n-way array, where
different dimensions have
different roles, and I would like to be able to use kronecker in the form
kronecker(A, B, make.dimnames=TRUE,
2010 Nov 29
2
R equivalent of Beaton's Sweep algorithm
I'm looking for an R equivalent of Beaton's (1964) Sweep algorithim for
partial inversion of a
matrix by pivoting.
It implemented in SAS/IML as sweep(matrix, indices), described here
http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/langref_sect266.htm
and here for python
http://adorio-research.org/wordpress/?p=262
--
Michael Friendly Email: friendly AT yorku
2011 May 16
1
dir.choose analog of file.choose
Under Windows (and maybe others) you can use file.choose() as a
substitute for an explicit file=
argument in most places.
Is there an analog for what I'll call dir.choose(), so that I can say
setwd(dir.choose())
thx,
-Michael
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele
2011 Nov 29
2
format numbers without leading or trailing 0s
A simple question, but I can't find something to do what I want:
Given: a vector of numbers, like
lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08)
Desired: format them in minimal space for use as plot labels, ie,
without leading or tailing 0s. For this example:
lambdaf <- c("0", .005", ".01", ".02", ".04", ".08")
--
Michael
2013 Mar 29
1
pairs(X,Y) analog of cor(X,Y)?
With a data frame containing some X & Y variables I can get the between
set correlations
with cor(X,Y):
> cor(NLSY[,1:2], NLSY[3:6])
antisoc hyperact income educ
math 0.043381307 -0.07581733 0.25487753 0.2876875
read -0.003735785 -0.07555683 0.09114299 0.1884101
Is there somewhere an analog of pairs(X,Y) that will produce the pairwise
plots of each X against each
2014 Oct 30
1
'library' or 'require' call not declared from: 'rgl'
I'm checking a new release of vcdExtra via win builder with R-devel
2014-10-29 r66897
and have run into a Warning I don't know how to fix.
I have one S3 generic, mosaic3d() that uses rgl and don't want to have
rgl always loaded
via Depends:. Instead, the mosaic3d.default() method includes
if (!require(rgl)) stop("rgl is required")
This always worked in the past, but
2012 Aug 22
1
multiline text() with different cex sizes
This question has probably been asked & answered before, but I can't
find it: How to print a
multiline figure caption in a plot, where different lines have different
fonts and font sizes,
and so that the lines of text are spaced in a reasonable way.
Here's a simple example, where I have to keep tweaking the y coordinate
and the
cex combos, while I also manually adjust the aspect
2014 Mar 04
1
forking a CRAN project
There is a CRAN package licensed just as "GPL", say, XX, I want to use
in a book.
But I've needed to modify the package to make it do what I need for
expository purposes.
The package author(s) are amenable to my modifications, but probably
unlikely to
incorporate them into the CRAN version any time soon.
Am I allowed, under GPL, to create a new version of the package, say
XX2,
2012 Aug 10
1
translating HTML character entities to accented characters
I've imported a .csv file where character strings that contained
accented characters were written as HTML
character entities. Is there a function that works on a vector to
translate them back to accented (latin1) characters?
Some examples:
> grep("&", author$lname, value=TRUE)
[1] "Frère de Montizon" "Lumière"
[3]
2013 Aug 22
1
Confusion about Depends:, Imports:, Enhances:, import(), inportFrom()
In checking my vcdExtra package, the following NOTE newly appeared
(R-Forge, using R version 3.0.1 Patched (2013-08-20 r63635))
Package in Depends field not imported from: ?gnm?
These packages needs to imported from for the case when
this namespace is loaded but not attached.
In the DESCRIPTION file, I have
Depends: R (>= 2.10), vcd, gnm (>= 1.0.3)
In NAMESPACE:
# we are a vcd
2010 Nov 30
1
warning creating an as.array method in a package
[Env: R 2.11.1, Win Xp, using Eclipse/StatET]
In a package I'm working on, I want to create as.matrix() and as.array()
methods for a particular kind of
object (log odds ratios). These are returned in a loddsratio object as
the $coefficients component,
a vector, but really reflect an underlying (R-1)x(C-1)xstrata array,
whose attributes are contained in other
components.
I define coef,
2011 Nov 08
2
NAMESPACES for data only packages
the NEWS file for R-devel says
*
Even data-only packages without *R* code need a namespace and so may
need to be installed under *R* 2.14.0 or later.
but what should this contain? Can it simply be an empty NAMESPACE
file? I assume that data does not have to
be exported.
-Michael
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University
2012 Nov 27
2
R CMD check: better diagnosis for non-ASCII characters
[Env: R 2.15.1, Win Xp]
Suggestion:
Could the R script that checks for non-ASCII characters in R CMD check
not give either:
(a) a pointer to tools:::showNonASCIIfile, as in,
try running tools:::showNonASCIIfile("Battig.Rd")
or,
(b) perhaps more useful, the result of tools:::showNonASCIIfile(file.Rd)
on the offending file(s).
I'm frequently bitten by this in preparing .Rd files
2013 Jul 06
0
fitting the null loglinear model with MASS::loglm??
The null loglinear model is an intercept-only model for log frequency,
log(f) = \mu
For a one-way table the test of the null model is the same as the
chisq.test.
This can be fit using loglin(), but I don't think there is any way to
specify this using MASS::loglm
> t1<- margin.table(Titanic,1)
> t1
Class
1st 2nd 3rd Crew
325 285 706 885
> loglin(t1, NULL)
0
2011 Apr 08
0
Consistency of messages from R CMD {check,build,install}
A minor gripe/request: Could all R CMD package tools not at the very
least be consistent in indicating when
they are done, as in
* DONE (packagename)
or at least
* DONE
R CMD build leaves one hanging, not knowing whether it has completed or
it is time to get another coffee.
* checking for file 'C:/Documents/workspace/heplots/DESCRIPTION' ... OK
* preparing 'heplots':
*