Displaying 20 results from an estimated 10000 matches similar to: "example() and example(package=) like data() and data(package=) ?"
2010 Feb 01
2
hiding/protecting utility functions in .Rprofile
[Env: WinXp, R 2.9.2]
In my .Rprofile, I define a number of utility functions I'd like to have
available in my R session, but don't want them
to be *normally* listed by ls(), or more importantly, saved if I save my
session variables/functions.
How can I do this?
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416
2008 Aug 17
1
how to override/replace a function in a package namespace?
I'm trying to test an extension of mosaic() from the vcd package that
requires a change to the
basic strucplot() function from that package. I want to test my change
by sourcing the
replacement function into my R session.
But when I do that,
source("c:/R/mosaics/strucplot-MF.R")
and run my extension, it is apparent that it is vcd:::strucplot that is
eventually called, not
my
2009 Dec 17
1
poly() with unnormalized values
How can I get the result of, e.g., poly(1:3. degree=2) to give me the
unnormalized integer coefficients
usually used to explain orthogonal polynomial contrasts, e.g,
-1 1
0 -2
1 1
As I understand things, the columns of x^{1:degree} are first centered
and then
are normalized by 1/sqrt(col sum of squares), but I can't
see how to relate this to what is returned by poly().
>
2006 Mar 23
1
comparative density estimates
I have two series of events over time and I want to construct a graph of the
relative frequency/density of these events that allows their
distributions to
be sensibly compared. The events are the milestones items in my project on
milestones in the history of data visualization [1], and I want to
compare trends
in Europe vs. North America.
I decided to use a graph of two overlaid density
2003 Sep 25
3
ungrouping grouped data
I'm sure this is probably simple, but I can't find an answer...
I have a data frame (Galton's data on heights of parents and children),
in grouped form,
parent child frequency
73.5 72.2 1
73.5 73.2 3
72.5 68.2 1
72.5 69.2 2
72.5 70.2 1
72.5 71.2 2
72.5 72.2 7
72.5 73.2 2
72.5 74.2 4
71.5 65.2 1
71.5 66.2 3
71.5 67.2 4
71.5 68.2 3
71.5 69.2 5
71.5 70.2 10
...
and need the ungrouped
2010 Jul 30
1
how to find non-ASCII characters in .Rd files?
[Env: Win XP Pro / R 2.11.1]
I keep occasionally running into the annoying problem of getting
warnings from R CMD check regarding
non ASCII characters in .Rd files, without any easy way of finding them.
Mostly these come from copy/paste of references or other material from
web pages or Win applications,
and often involve varieties of quote-like characters, e.g., if I try to
include output
2008 Sep 17
1
rgl: plot3d and ellipse3d
Hi
I'm trying to make a 3d plot showing a point cloud, the corresponding
data ellipse
and the principal axes of the ellipse as vectors.
library(rgl)
data(trees)
cov <- cov(trees)
mu <- mean(trees)
plot3d(trees, type="s", size=0.5, col="blue", cex=2)
In this step, an extra box is added. I've tried using box=FALSE, but it
has no effect.
# how to avoid the
2009 Nov 13
1
vignettes: .png graphics or pre-compiled .pdf
In a package I'm working on there is a vignette with a number of graphs
that result in huge .pdf files, so
the .pdf for the vignette is around 17 Mb. If these graphs are
converted to .png, and the .tex file
is compiled with pdflatex, the resulting .pdf is ~1 Mb.
I'm reluctant to put the .Rnw file into the package as is, generating
the huge .pdf for the vignette.
I first tried
2006 Sep 07
0
plot image matrix with row/col labels
I'm working with an historical image that may be (one of?) the first
uses of gray-scale shading to show the pattern of values in a
matrix/table, later used by Bertin in his 'reorderable matrix'
and sometimes called a scalogram.
The image is at
http://euclid.psych.yorku.ca/SCS/Gallery/images/Private/scalogram.jpg
The rows refer to the arrondisements of Paris, the cols to various
2008 Sep 01
3
how to read multiple lines per case
How can I read a space-delimited file, where the data values for each case
are folded before column 80, and so appear on two lines for each case?
The first few cases look like this
loc type bio H2S sal Eh7 pH buf P K Ca Mg Na Mn Zn Cu NH4
OI DVEG 676 -610 33 -290 5.00 2.34 20.238 1441.67 2150.00 5169.05 35184.5
14.2857 16.4524 5.02381 59.524
OI DVEG 516 -570 35 -268 4.75 2.66 15.591 1299.19
2009 Apr 02
1
calculating drop1 R^2s
This is probably simple, but I just can't see it...
I want to calculate the R^2s for a series of linear models where each
term is dropped in turn. I can get the
RSS from drop1(), and the r.squared from summary() for a given model,
but don't know how to use the
result of drop1() to get the r.squared for each model with one term dropped.
Working example:
library(vcd) # for
2010 Jan 11
2
example() leaves console prompting to press Enter for new graphs
Env: Win XP, R 2.9.2]
It's a minor annoyance, but I find that after I run example(), the
console state of prompting to press Enter for
each new graph remains as it is under example. It's more annoying that
it seems difficult to turn this behavior
off!
In a fresh session:
> getOption("example.ask")
[1] "default"
Run an example:
> example(plot)
plot>
2007 May 15
1
apt-get update: GPG error from cran.R-project.org
I recently was forced to do a dist-upgrade and rebuild my kernel, so a
lot has
changed on my system, and I don't know if that is related to the errors
& warnings
I get from apt-get update.
Any ideas?
thanks
-Michael
euclid:~# apt-get update
Get: 1 http://debian.yorku.ca stable Release.gpg [378B]
Get: 2 http://debian.yorku.ca stable/updates Release.gpg [189B]
Get: 3
2007 Dec 03
1
cor(data.frame) infelicities
In using cor(data.frame), it is annoying that you have to explicitly
filter out non-numeric columns, and when you don't, the error message
is misleading:
> cor(iris)
Error in cor(iris) : missing observations in cov/cor
In addition: Warning message:
In cor(iris) : NAs introduced by coercion
It would be nicer if stats:::cor() did the equivalent *itself* of the
following for a data.frame:
2008 Oct 29
2
sessionInfo() error
[Using R 2.7.2 on Windows XP]
After re-building our heplots package, I've begun to get the following
error from sessionInfo(),
even though it passes R CMD check and builds without errors:
> sessionInfo()
Error in x$Priority : $ operator is invalid for atomic vectors
In addition: Warning message:
In FUN(c("MASS", "heplots", "car", "rgl",
2003 Aug 27
0
Minard's Challenge: Re-Visioning Minard Contest
In a recent talk ('Visions of the Past, Present & Future of Statistical
Graphics'),
I talked about, among other things, the lessons Minard's March on Moscow
graphic had
for modern statistical graphics, and illustrated aspects of power and
simplicity
in several programming languages where this graphic had been recreated.
I referred to 'elegance factors' of various
2008 Apr 18
0
new candisc package on CRAN
I'm happy to announce the candisc package, v 0.5-9, now on CRAN.
Generalized Canonical Discriminant Analysis
Description
This package includes functions for computing and visualizing
generalized canonical discriminant analyses for a multivariate linear
model. They are designed to provide low-rank visualizations of terms in
a mlm via the plot method and the heplots package.
The methods
2008 Apr 18
0
new candisc package on CRAN
I'm happy to announce the candisc package, v 0.5-9, now on CRAN.
Generalized Canonical Discriminant Analysis
Description
This package includes functions for computing and visualizing
generalized canonical discriminant analyses for a multivariate linear
model. They are designed to provide low-rank visualizations of terms in
a mlm via the plot method and the heplots package.
The methods
2008 May 30
1
robust mlm in R?
I'm looking for something in R to fit a multivariate linear model
robustly, using
an M-estimator or any of the myriad of other robust methods for linear
models
implemented in robustbase or methods based on MCD or MVE covariance
estimation (package rrcov).
E.g., one can fit an mlm for the iris data as:
iris.mod <- lm(cbind(Sepal.Length, Sepal.Width, Petal.Length,
Petal.Width) ~ Species,
2008 Dec 10
2
read.*: How to read from a URL?
The question is how to use a URL in place of a file= argument for
read.*.functions that do
not support this internally.
e.g., utils::read.table() and her family all support a file= argument
that can take a URL
equally well as a local file. So, if I have a file on the web, I can
equally well do
> langren <- read.csv("langrens.csv", header=TRUE)
> langren <-