Displaying 20 results from an estimated 10000 matches similar to: "Splitting printed output in Sweave"
2005 Sep 08
1
Creating very small plots (2.5 cm wide) in Sweave
Hi everyone,
I was wondering if anyone has any code they could share for creating
thumbnail plots in Sweave. For example, I'd like a plot like the
following:
y <- c(40, 46, 39, 44, 23, 36, 70, 39, 30, 73, 53, 74)
x <- c(6, 4, 3, 6, 1, 5, 6, 2, 1, 8, 4, 6)
opar <- par(mar=c(3,3,0,0))
plot(x, y, xlab="", ylab="")
abline(h=mean(y), col="red")
par(opar)
2006 Feb 19
3
Changing predictor order in lm()
Dear community,
can anyone provide a snippet of code to force the lm() to fit a model with
terms in the formula in an arbitrary order? I am interested in something
like:
lm(y ~ A * B + C, data=data)
where the interaction of A and B should be in the formula before C. My
goal is to simplify my presentation of models using the anova() statement.
I have found that this should be possible using
2008 Jan 14
1
[Off Topic] searching for a quote
Dear community,
I'm trying to track down a quote, but can't recall the source or the
exact structure - not very helpful, I know - something along the lines
that:
80% of [applied] statistics is linear regression ...
?
Does this ring a bell for anyone?
Thanks,
Andrew
--
Andrew Robinson
Department of Mathematics and Statistics Tel: +61-3-8344-9763
University of
2011 Jun 14
2
Off-topic: (Simple?) Random Sampling when n is a random variable
Hi everyone,
I'm involved in a discussion with a colleague. He suggested a sample
design for a finite-sized process that (to all intents and purposes)
involves tossing a coin and examining the unit if the coin shows
Heads.
I should emphasize that we're both approaching the problem from a
design-based sampling theory point of view. So I have no argument
about the appropriateness of the
2006 Jan 11
2
Problem with making Matrix
Hi R-help citizens,
I'm having trouble making version 0.99-6 of Matrix on FreeBSD 6.0.
The error message is:
* Installing *source* package 'Matrix' ...
** libs
gcc -I/usr/local/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES -fPIC -g -O2 -c Csparse.c -o Csparse.o
... numerous lines deleted ...
gcc -I/usr/local/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES
2005 Nov 09
2
Sort a dataframe
Dear All,
How can I sort a data frame (using one of the column)?
Thanks for your support.
Regards.
Abd. Rahman Kassim (PhD)
Head Forest Ecology Branch
Forest Management & Ecology Program
Forestry and Conservation Division
Forest Research Institute Malaysia
Kepong 52109
Selangor, Malaysia
*****************************************
Checked by TrendMicro Interscan Messaging Security.
For any
2007 Nov 06
1
A suggestion for an amendment to tapply
Dear R-developers,
when tapply() is invoked on factors that have empty levels, it returns
NA. This behaviour is in accord with the tapply documentation, and is
reasonable in many cases. However, when FUN is sum, it would also
seem reasonable to return 0 instead of NA, because "the sum of an
empty set is zero, by definition."
I'd like to raise a discussion of the possibility of an
2007 Mar 16
3
ARIMA standard error
Hi,
Can anyone explain how the standard error in arima() is calculated?
Also, how can I extract it from the Arima object? I don't see it in there.
> x <- rnorm(1000)
> a <- arima(x, order = c(4, 0, 0))
> a
Call:
arima(x = x, order = c(4, 0, 0))
Coefficients:
ar1 ar2 ar3 ar4 intercept
-0.0451 0.0448 0.0139 -0.0688 0.0010
s.e.
2006 May 16
5
Interrater and intrarater variability (intraclass correlation coefficients)
Hello!
I want to calculate the intra- and interrater reliability of my study. The design is very simple, 5 raters rated a diagnostic score 3 times for 19 patients.
Are there methods/funtions in R? I only found packages to calculate interrater variability and intraclass correlation coefficients for matrices of n*m (n subjects, m raters) - I have n subjects, m raters and r repetitions.
Can
2006 Jan 30
2
How to add two different axis to one plot?
Hi all,
I need to put two different axis to one plot. On the top of the plot, I need
to put one axis, with increments from left side to the right side; then at
the bottom of the same plot, I need to put another axis, with increments
from right side to the left side and showing a different unit. How do I do
that?
By the way, is there a "hold" command for plotting?
If I first plot a
2006 Jul 23
3
Making a patch
Dear R developers,
is there a preferred format or strategy for making a patch to
contribute to a package that is maintained by R-core? Berwin Turlach
and I have written a very minor extension to lmeControl to allow it to
pass an argument to nlminb for the maximum number of evaluations of
the objective function. I've edited the nlme/R/lme.R and
nlme/man/lmeControl.Rd files. I can diff the
2005 Oct 13
6
shell scripts in R
Hi,
How can I execute some scripts from within R.
I have a large data file which I process (for instance with gawk, but not
only) before performing some statistics.
I would like to do this in R, so that I do not have to save many data files
and then making analysis on them (which proved to be unefficient)
Thank you
Marco Grazzi
2006 Jul 23
1
How to pass eval.max from lme() to nlminb?
Dear R community,
I'm fitting a complex mixed-effects model that requires numerous
iterations and function evaluations. I note that nlminb accepts a
list of control parameters, including eval.max. Is there a way to
change the default eval.max value for nlminb when it is being called
from lme?
Thanks for any thoughts,
Andrew
--
Andrew Robinson
Department of Mathematics and Statistics
2006 Oct 21
4
one is not one
Folks,
I have got a strange behaviour when testing this:
sum(x) != 1
let us set
x<-c(70,134,1,5,0)
and transform it in a vector of probabilities
x<-x/sum(x)
One expect sum(x) should be equal to 1, which is apparently the case
> sum(x)
[1] 1
However, when I try to test it I get:
> if(sum(x) !=1) print("lost") else ("OK")
[1] "lost"
Which means
2006 Mar 31
1
Odd anova(lm()) order phenomenon, looking for an explanation
Hi everyone,
I'm witnessing an odd modelling phenomenon that I can't explain. If
anyone has seen this before, or can explain what's going on would let
me know, I'd be very grateful! Especially if I'm just being dim.
I'm fitting a pair of continuous variates and their interaction to
some residuals from another model. The sequential anova statement
changes with the term
2006 Oct 24
1
Cook's Distance in GLM (PR#9316)
Hi Community,
I'm trying to reconcile Cook's Distances computed in glm. The
following snippet of code shows that the Cook's Distances contours on
the plot of Residuals v Leverage do not seem to be the same as the
values produced by cooks.distance() or in the Cook's Distance against
observation number plot.
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
2006 Aug 15
1
A model for possibly periodic data with varying amplitude [repost, much edited]
Hi dear R community,
I have up to 12 measures of a protein for each of 6 patients, taken
every two or three days. The pattern of the protein looks periodic,
but the height of the peaks is highly variable. I'm testing for
periodicity using a Monte Carlo simulation envelope approach applied
to a cumulative periodogram. Now I want to predict the location of
the peaks in time. Of course, the
2008 May 26
1
Sweave does not respect width
Hello,
I'm learning to use Sweave, and I've run into a problem: sometimes, when
entering long lines of input and using long variable names, Sweave will not
insert linebreaks in a way that respects the width setting. This causes
undesirable overflows into the margins in the latex file. For example,
consider the following document (adapted from the GLM example):
\documentclass{article}
2005 Sep 25
1
R CMD build produces tar error under FreeBSD 5.4
Hi R-helpers,
I am trying to build a package under FreeBSD 5.4-RELEASE #0 using R
Version 2.1.1.
I have constructed a package using package.skeleton(), when I try
$ R CMD build foo
* checking for file 'foo/DESCRIPTION' ... OK
* preparing 'foo':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* removing junk files
tar: Option -L is not permitted in mode -x
Error:
2007 Apr 25
3
aggregate similar to SPSS
Hi,
Does anyone know if: with R can you take a set of numbers and aggregate
them like you can in SPSS? For example, could you calculate the percentage
of people who smoke based on a dataset like the following:
smoke = 1
non-smoke = 2
variable
1
1
1
2
2
1
1
1
2
2
2
2
2
2
When aggregated, SPSS can tell you what percentage of persons are smokers
based on the frequency of 1's and 2's. Can