Displaying 20 results from an estimated 5000 matches similar to: "Request: kronecker to get a sep= argument"
2005 Dec 08
1
kronecker(... , make.dimnames=TRUE)
Hi
I'm using kronecker() with a matrix and a vector. I'm interested in
the column names that kronecker() returns:
> a <- matrix(1:9,3,3)
> rownames(a) <- letters[1:3]
> colnames(a) <- LETTERS[1:3]
> b <- c(x=1,y=2)
> kronecker(a,b,make.dimnames=TRUE)
A: B: C:
a:x 1 4 7
a:y 2 8 14
b:x 2 5 8
b:y 4 10 16
c:x 3 6 9
c:y 6 12 18
>
The
2013 Feb 23
1
how to calculate left kronecker product?
For an application, I have formulas defined in terms of a left Kronecker
product of matrices,
A,B, meaning
A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each
element on the right.
The standard kronecker() function is the right Kronecker product,
A \otimes_R B = {A[i,j] * B} -- matrix on the right multiplies each
element on the left.
The example below shows the result of
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 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
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.
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
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
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
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;
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
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 <-
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 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 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=':') {
2011 Sep 09
3
Read a list of files into named R data.frames
I have a collection of .csv files in a directory, and want to read them
into R data.frames whose names
are the same as the file names, without the .csv extension
e.g., from
> (files <- list.files(pattern="*.csv"))
[1] "Allstar.csv" "AllstarFull.csv"
[3] "Appearances.csv" "AwardsManagers.csv"
[5]
2011 Sep 16
2
R license for a derived data-only package
I'm looking for guidance or advice about the R license to use in
preparing a package containing the
Baseball Database from http://baseball1.com/statistics/
My main purpose is to make it available to students in a course, and to
develop it with others
I'd like to put it on R-Forge, and then perhaps make it public on CRAN.
However, the page above bears a very restrictive copyright notice