Displaying 20 results from an estimated 3000 matches similar to: "how to fix a factor"
2004 May 03
2
adding a method to the dist function
Hi all,
I'd like to add the Bhattacharyya method to the dist function.
What is the best way to do this? I'm using R 1.9.0 and I was looking
for the code that defines the already existing distances, but I didn't
manage. As far as I understand, dist is defined in mva that is part
of the stats package now, but where is the code?
Thank you very much,
Giampiero
2004 Jan 16
2
reference to objects
Hi,
is there a way to reference to a data object without copying it?
For example I have a huge matrix called dist and I want two objects
obj1 and obj2 to have a memeber dist that points to the matrix, but
I don't want, for memory reasons, to copy the matrix twice.
As far as I understand the following code will generate three copies
of my data:
dist <- some_code_that_generates_data
2007 Jan 19
2
combn implementation
Hi,
I was checking the source code to the function combn that "generates
all combinations of the elements of 'x' taken 'm' at a time.",
because I wished to modify it. I have a doubt about a statement.
This is the main loop.
._1 <- 1:1
nmmp1 <- n - m + ._1
while (a[1] != nmmp1) {
if (e < n - h) {
h <- ._1
e <-
2007 Feb 28
1
incremental plots with pdf and dev.copy
Hi,
I am trying to produce incremental plots directly using the pdf
device. I mean that I want to produce a plot, save it in a pdf
file, then add details and save the new plot in a new file, and
so on. Before I used to do this with x11, by just adding graphics to
a plot and then using dev.copy2eps at the right times for each eps
figure. Now I want to do this in batch mode and the x11 device is not
2006 Dec 13
2
Phonetic symbols (IPA) in R graphics
Hi all,
I would like to add phonetic symbols in my figures. Usually I typeset
my documents in LaTeX and I use the tipa [1] package to get
International Phonetic Alphabet (IPA) fonts. So, my problem would be
solved if I could insert LaTeX commands in the text() function (I
guess at least).
I would like to avoid using psfrag (that is, inserting a string in
the eps figure and then substituting it
2007 Feb 28
1
adding graphics after dev.copy
Hi,
I am trying to create a plot and save it as pdf to the file
file1.pdf, then add some details and save the new plot as file2.pdf.
I would like to avoid repeating all the instructions needed to create
file1.pdf when I create file2.pdf.
This is what I have tried:
pdf(file="file1.pdf")
plot(1:10)
dev.copy(pdf,file="file2.pdf")
points(2,3)
dev.off()
dev.off()
When I run
2004 Feb 02
2
ordering in dotplot
Dear R-friends,
the dataset I am using (data.it) is organized as follows
partner stp btp reg
hk 0.64 1 s
ger 0.27 1 d
tur 0.27 1 s
rom 0.24 1 s-f
por 0.24 1 s
spa 0.23 1 s
gre 0.22 1 d-f
aus 0.17 1 d
uk 0.16 1 s
be 0.16 1 d
arg 0.15 1 s
usa 0.13 1 d-f
fra 0.13 1 s
neth
2005 Apr 19
2
Odd diagnostic plots in mixed-effects models
Dear R community,
In the excellent nlme package the default diagnostic plot graphs the innermost residuals against innermost fitted values. I recently fit a mixed-effects model in which there was a very clear positive linear trend in this plot.
I inferred that this trend occurred because my fixed effect was a two-level factor, and my random effect was a 12-level factor. The negative residuals
2004 Nov 10
1
List seems to drop empty levels of factors when containin g them
I don't get the same result, do you have a package loaded that would change
the default behavior (such as Hmisc)?
> list(grp.1)
[[1]]
[1] 1 2
Levels: 1 2
> list(grp.1[mask])
[[1]]
[1] 1
Levels: 1 2
> library(Hmisc)
<<snip>>
> list(grp.1[mask])
[[1]]
[1] 1
Levels: 1
--Matt
> version
_
platform i386-pc-mingw32
arch i386
os
2002 Jul 18
3
Oddity with names
Hi all,
I'm using R 1.5.1 on Windows 2000. The following snippet of code doesn't
seem to do anything - no error is reported, and there is no name change.
names(myFrame[,c(1:3)]) <- c("name1", "name2", "name3")
This code however works nicely:
names(myFrame)[c(1:3)] <- c("name1", "name2", "name3")
Can anyone suggest why
2003 Mar 08
2
Looking for non-central F quantile
Greetings all,
I'm trying to figure out how to calculate the inverse CDF (i.e. a
quantile) for a non-central F distribution. I could put together a quick
numerical solver routine using the CDF, but I wonder if there's a function
that I've missed that would be more efficient?
Thank-you,
Andrew
Andrew Robinson Ph: 208 885 7115
Department of Forest Resources Fa: 208 885
2004 Mar 23
2
Coefficients and standard errors in lme
Hello,
I have been searching for ways to obtain these for combinations of fixed
factors and levels other than the 'baseline' group (contrasts coded all
0's) from a mixed-effects model in lme. I've modelled the continuous
variable y as a function of a continuous covariate x, and fixed factors
A, B, and C. The fixed factors have two levels each and I'd like to know
whether
2004 Sep 21
2
Bootstrap ICC estimate with nested data
I would appreciate some thoughts on using the bootstrap functions in the
library "bootstrap" to estimate confidence intervals of ICC values
calculated in lme.
In lme, the ICC is calculated as tau/(tau+sigma-squared). So, for instance
the ICC in the following example is 0.116:
> tmod<-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
> VarCorr(tmod)
IDGRUP = pdLogChol(1)
2004 Mar 10
3
converting lists got by tapply to dataframes
I have two lists:
xa <- list( X=c(1,2,3), Y=c(4,5,6), Z=c(7,8,9) )
xb <- with( barley, tapply( X=seq(1:nrow(barley)), INDEX=site
, FUN=function(z)yield[z]))
I can convert xa to a dataframe easily with:
as.data.frame(xa)
But if i try the same with xb I get:
as.data.frame(xb)
Error in as.data.frame.default(xb) :
can't coerce array into a data.frame
What
2004 Mar 26
8
stop() vs. error() ?
Why does stop("we are done") print
"Error in eval.with.vis(expr, envir, enclos) :" ?
It would seem to me that a plain stop() is not an error, and that it
would make more sense to have an error() function that is different from
a stop(). Is there a rationale here that I am missing?
sincerely, /iaw
2004 Dec 13
2
Farmating printed Numbers and Text
Hello,
is there any function to print (using "cat" or "print" etc.) a table of
values row per row in a exact order, even if the value has 3 digit and in
the next row eg. 5 digits? This means I want to print a number with 3 digits
with 2 spaces in front and a number with 4 digits only with one space in
front.
regards Andreas
2002 Jul 07
2
R on Sharp Zaurus 5500?
Hello,
has anyone tried to get R running on a Sharp Zaurus 5500?
Andrew
Andrew Robinson Phone: 208-885-7115
Department of Forest Resources Fax: 208-885-6226
University of Idaho E: andrewr at uidaho.edu
Po Box 441133 WWW: http://www.uidaho.edu/~andrewr
Moscow, ID 83843 and: http://www.biometrics.uidaho.edu/
No statement above
2002 May 06
1
Load Data
Dear R Users
What's the easiest way to load an excel data file to R?
Thanks
Rick
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 19/4/2002
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2004 Jan 03
1
R doesn't run on g4 iBook with Panther
I have a 12" G4 iBook with the latest os (Panther) with the recent
updates. When I start R by double clicking, it expands for a fraction of
a second and then, nothing happens.
There is mention in the readme about using something called "i-install"
to uninstall a mistakenly installed library, but I do not know how to do
this.
Any help would be appreciated.
Thanks,
Martin
2004 Oct 04
1
Could anyone tell me how to extract pvalue from "lm" fitting?
Dear R people,
I have a naive question: after fitting "lm" to a data, I can't extract
the pvalue corresponding to a specific covariate in a direct way.
Could anyone give me a hint?
Thank you very much.
Frank