Displaying 20 results from an estimated 9000 matches similar to: "format numbers without leading or trailing 0s"
2011 Dec 05
1
finding interpolated values along an empirical parametric curve
Given the following data, I am plotting log.det ~ norm.beta, where the
points depend on a parameter, lambda
(but there is no functional form).
I want to find the (x,y) positions along this curve corresponding to two
special values of lambda
lambda.HKB <- 0.004275357
lambda.LW <- 0.03229531
and draw reference lines at ~ -45 degrees (or normal to the curve) thru
these points.
How can I do
2011 Aug 06
0
ridge regression - covariance matrices of ridge coefficients
For an application of ridge regression, I need to get the covariance
matrices of the estimated regression
coefficients in addition to the coefficients for all values of the ridge
contstant, lambda.
I've studied the code in MASS:::lm.ridge, but don't see how to do this
because the code is vectorized using
one svd calculation. The relevant lines from lm.ridge, using X, Y are:
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
2011 Nov 04
3
replace double backslash with singel backslash
I want to replace \\ with \ in:
str <-
"C:\\DOKUME~1\\u0327336\\LOKALE~1\\Temp\\RtmpQ5NJ8X\\TIRIS_PICS\\1_Img.jpg"
and tried:
gsub("\\\\", "\\", str)
but this removes the \\ without replacing them by \
Any help much appreciated,
Kay
-----
------------------------
Kay Cichini
Postgraduate student
Institute of Botany
Univ. of Innsbruck
------------------------
2010 Oct 06
5
R: Tools for thinking about data analysis and graphics
I'm giving a talk about some aspects of language and conceptual tools
for thinking about how
to solve problems in several programming languages for statistical
computing and graphics. I'm particularly
interested in language features that relate to:
o expressive power: ease of translating what you want to do into the
results you want
o elegance: how well does the code provide a simple
2012 Jun 03
3
Modify pdf file with Illustrator.
Dear list,
Some times I want to modify the pdf file which produced by R with
illustrator. But when I use Illustrator open the pdf file, it often
makes the pdf some little changed. Anyone have some suggestions? Is it
better to use other file type, not pdf? Or when I produced the pdf, I
should set some other parameters?
Thank you
2014 May 07
3
historical significance of Pr(>Chisq) < 2.2e-16
Where does the value 2.2e-16 come from in p-values for chisq tests such
as those
reported below?
> Anova(cm.mod2)
Analysis of Deviance Table (Type II tests)
Response: Freq
LR Chisq Df Pr(>Chisq)
B 11026.2 1 < 2.2e-16 ***
W 7037.5 1 < 2.2e-16 ***
Age 886.6 8 < 2.2e-16 ***
B:W 3025.2 1 < 2.2e-16 ***
B:Age 1130.4 8 < 2.2e-16 ***
W:Age 332.9 8 < 2.2e-16 ***
---
Signif.
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 Jul 31
3
R 2.13.1 can't find package binaries on R-Forge
[Env: Win XP]
I've just upgraded from R 2.12.2 to R 2.13.1. As part of my upgrade
process, I typically install some in-development
packages from R-Forge that are not on cran. But for the first time, it
doesn't work.
e.g.,
> install.packages("p3d", repos="http://R-Forge.R-project.org")
trying URL
2013 Jan 31
4
CRAN task views: markdown? better .CSS?
CRAN task views are useful, but they seem difficult to write and
maintain because the XML format is rather
limited (no sectioning) and the <packagelist> must be maintained manually.
They are also difficult to read because the generated html and .css used
are extremely basic, giving an
overly dense page.
Are there any markdown-like tools for writing a CTV? Is it possible to
apply a
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 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;
2010 Nov 03
3
R package BibTex entries: looking for a more general solution
== Summary ==
* Problem: BibTeX entries extracted from R packages via citation()
require too much manual editing to be
of general use.
* Proposal: Date: fields should be made mandatory in package DESCRIPTION
files, perhaps
beginning with warnings from R CMD check
* Proposal: Package authors should be encouraged to use a (new)
Contributors: field in the DESCRIPTION file
rather than packing all
2013 Aug 23
2
packages with Sweave and knitr vignettes?
Now that R 3.0.0+ supports non-Sweave vignettes, R-exts \S 1.4.2 seems
to imply that
it is possible to include both Sweave and knitr vignettes in a single
package.
I'm wondering
if anyone has tried this and/or if there are some hidden gotchas putting
this into practice,
and concerned about creating problems with CRAN checks if I try this.
Consider two vignettes:
pkg/vignettes/vign1.Rnw,
2013 Mar 08
2
ggplot2: modifying line width and background fill color for stat_smooth()
In the example below, from
http://www.ling.upenn.edu/~joseff/rstudy/summer2010_ggplot2_intro.html
I'd like to make (a) the fitted line thicker and (b) change the
background fill color for the confidence
envelope around each fitted line to a low-alpha transparent version of
the same color used
for the separate fitted lines for GENDER, rather than grey for both.
How can I do this?
2011 May 07
1
generate multiple mvrnorm samples using apply-like
I want to generate multiple multivariate normal samples with different
mean vectors
and common covariance matrix.
I can do this with a loop, but can't quite figure out how to do it with
apply and friends.
In the example below, I want values to have 3 columns: group, x, y
# number of groups, and group means
x <- jitter(seq(2,10,by=2))
y <- x + rnorm(length(x), 0, .5)
means <-
2010 Nov 27
1
return vector of element names for vector, matrix or array
Just as as.vector() takes a vector, matrix or array and returns a
vector in row-major order,
I'd like to write a function to take such an object and return the
dimension names,
pasted with some separator, as a similar vector.
Here is something ugly cobbled together to demonstrate what I want: a
function to work
for any number of dimensions.
vecnames <- function(x, sep=':') {
2013 Dec 17
1
ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula
With ggplot2, I can plot the glm stat_smooth for binomial data when the
response is binary or
a two-level factor as follows:
data("Donner", package="vcdExtra")
ggplot(Donner, aes(age, survived)) +
geom_point(position = position_jitter(height = 0.02, width = 0)) +
stat_smooth(method = "glm", family = binomial, formula = y ~ x,
alpha = 0.2, size=2)
But how can I
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,