I nearly forgot to thank Andy Liaw and Tony Plate for their help with this
problem. BTW Andy's method does run faster than the natural fix-up of my
original code.
Murray Jorgensen
You are using the connection the wrong way. You need to do something
like:
fcon - file(c:/data/perry/data.csv,
Hi Everyone,
Here's a silly newbie question. How do I remove unwanted rows from an
R table? Say that I read my data as:
X - read.table(mydata.txt)
and say that there are columns for age and gender. Call these X[5] and
X[10], respectively.
Here, X[5] is a column of positive integers and
Hi Francisco,
what I would do :
names(X)[c(5,10)]-c(Age,Gender)
Xnew1-X[X$Gender==1 X$Age=18 X$Age =40,]
Xnew2-X[X$Gender==0 X$Age=20 X$Age =30,]
Xnew-rbind(Xnew1,Xnew2)
But there must be something more elegant,
Good luck,
Arnaud
-Original Message-
From: Francisco J. Bido
Al Piszcz wrote:
mtext does not appear to be rendering a 'bold' expression.
Is there another parameter to set? Thx.
example (does not create bold (font=2) on plot)
mtext( font=2, expression(paste(y, = , x + z), side=3 )
Mathematical expressions are handled differently from normal text.
You
Thanks everyone! I now see how to handle the situation. This has to
be the most responsive mailing list ever...
Best,
-Francisco
On Friday, August 29, 2003, at 01:39 AM, Andrew Hayen wrote:
Also see this page: http://www.ats.ucla.edu/stat/SPLUS/faq/subset_R.htm
A
-Original Message-
Hi
I try to create from a data frame a new one which contains only the
numerical variables (or factorial ones).
Is there any function which does this task directly ?
Or, is there any function which return the mode of each columns of a data
frame. ?
Thanks a lot for any help you can offer me,
On Fri, 29 Aug 2003, Vincent Spiesser wrote:
Hi
I try to create from a data frame a new one which contains only the
numerical variables (or factorial ones).
Is there any function which does this task directly ?
Or, is there any function which return the mode of each columns of a data
for data.frame called dframe:
newframe - dframe[ , lapply(dframe, is.numeric)]
For the mode of the columns
lapply(dframe, mode)
See ?lapply !!
-Original Message-
From: Vincent Spiesser [mailto:[EMAIL PROTECTED]
Sent: 29 August 2003 10:08
To: [EMAIL PROTECTED]
Subject: [R] extract
Hello!
Can I somehow set x11 device to use font different from default
helvetica-arial (times for example?)? Is this font hardcoded into R or
can I substitute some other system font? Does x11 device use
standard/user-supplied .Xresources file (under Linux)?
The questions are the same for gtk()
Consider the following examples:
library(lattice)
x = c(1,1,2,2)
y = c(1,2,1,2)
z = 1:4
levelplot(z~x+y,at=c(.5, 1.5, 2.5, 3.5, 4.5)) # correct
levelplot(z~x+y,at=c(.5, 1.5, 2.5)) # ?
The second plot is clearly incorrect. However, I don't know
what correct behaviour is: ignore
You have the sources (for each), so why not read them?
The Unix X11 device has this helvetica hardcoded: what has arial to do
with it? If you would like more flexibility, please supply a patch
against the current R-devel sources.
On Fri, 29 Aug 2003, M.Kondrin wrote:
Can I somehow set x11
Hi everyone,
I want to write a function that modify directly variables passed as
parameters (the equivalent in C language of *ptr/ptr) so that I don't
have to return a list and to reaffect all my variables.
Is it possible to do so in R?
Thanks a lot.
Laetitia Marisa.
I want to write a function that modify directly variables passed as
parameters (the equivalent in C language of *ptr/ptr) so that I don't
have to return a list and to reaffect all my variables. Is it possible
to do so in R? Thanks a lot.
You can use environments as they're passed by
On Fri, 29 Aug 2003, Laetitia Marisa wrote:
I want to write a function that modify directly variables passed as
parameters (the equivalent in C language of *ptr/ptr) so that I don't
have to return a list and to reaffect all my variables.
Is it possible to do so in R?
Yes, with the
I would use the subset() function. Assuming the data frame has variable
names Gender and Age, you could do:
Y1 - subset(X, Gender == 1 Age = 18 Age = 40)
Y2 - subset(X, Gender == 0 Age = 20 Age = 30)
-roger
Francisco J. Bido wrote:
Hi Everyone,
Here's a silly newbie question. How do I
Three references that are of interest (the two first are related to the
idea of using environments to do the job):
[1] http://www.maths.lth.se/help/R/ImplementingReferences/
[2] http://www.maths.lth.se/help/R/R.oo/
[3] http://www.omegahat.org/OOP/
All of the above are written in the light
Hi,
First of all a big THANK YOU to all who answered me
yesterday.
I am back to my problems with outliers. I did a qqnorm on my
data (as somebody suggested), but I will like to compare results
doing other plots as well. I used cook.distance on lm and glm
objects, but still I am not happy
Henrik Bengtsson wrote:
All of the above are written in the light object-oriented programming,
but from [1] you quite easily get what is needed for just emulating
pointers. Be careful though as R is a functional language.
Cutting to what I think was the gist of the original poster's question,
foo - function(y) assign(deparse(substitute(y)), y^2, parent.frame())
assigns to the calling frame. Or you could put the required frame as
a second argument.
-Original Message-
From: Barry Rowlingson [mailto:[EMAIL PROTECTED]
Cutting to what I think was the gist of the original
Hi,
I am trying to plot a time serie of six colum of data sets on one plot but
with using a different y-axis ranges for each - preferably with one shown
on each side of the graph. I'm trying with axis function but not good luck
i will for each they plot with our proper scale and range for
The following works is tuned for S-Plus 6.1, but these tools can be used
to produce what I hear in your question:
par(mar=c(5,7,4,7)+.1)# create space for 2 axes on each side
plot(0:1, 0:1, type=l, ylab=y1)
axis(side=2, at=(1:2)/3, labels=(1:2)/3, line=4)
mtext(text=y2, side=2, line=6.5)
On Friday 29 August 2003 05:22, Edzer J. Pebesma wrote:
Consider the following examples:
library(lattice)
x = c(1,1,2,2)
y = c(1,2,1,2)
z = 1:4
levelplot(z~x+y,at=c(.5, 1.5, 2.5, 3.5, 4.5)) # correct
levelplot(z~x+y,at=c(.5, 1.5, 2.5)) # ?
The second plot is clearly incorrect.
Win2k, R1.7.1:
I am currently working with some growth curve data from a
biotoxicology experiment. Each of 12 subjects had their blood
drawn at 0, 2, 4, 6, 8, and 10 weeks. For the purposes of the
project, it would be helpful if I were able to do the following:
a. Produce 12 panels,
Hi,
I'm somewhat new to R and I'm trying to figure out the difference
between the operators - and =.
I've noticed that - cannot be used to bind arguments to values in
function definitions and calls. That is, f(x - 2) sets x to 2 in the
calling frame and then calls f(2) because the expression
Levi Larkey schrieb:
Hi,
I'm somewhat new to R and I'm trying to figure out the difference
between the operators - and =.
- is an assignement operator
= is primarily used for named arguments
Some thoughts about the use of = as assignement operator can be found on:
Let's consider this simulated data:
foo - data.frame(resp = do.call(c, lapply(as.list(rep(6, 12)),
function(x) sort(rnorm(x,
week = rep(2*0:5, 12),
id = factor(rep(1:12, each = 6)))
Does the following give you what you want ?
Thank you VERY much! That does address my questions.
Respectfully,
david paul
-Original Message-
From: Deepayan Sarkar [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 1:54 PM
To: Paul, David A; '[EMAIL PROTECTED]'
Subject: Re: [R] Lattice plot questions
Let's consider this
Hello,
I am using lattice to plot histograms of one variable conditioned on
another continuous variable. for this I am using equal.count on the
conditioning variable to get the appropriate shingle. I would like to
have in my plot a representation of the shingle's intervals including
the min/max
The typical graphical representation for shingles is via plot.shingle, e.g.
a - equal.count(rnorm(100))
plot(a)
I'm not sure how you wish to represent this information inside the histogram
plot itself, but everything you need should be available inside the strip
function. For example,
Hi,
I have a question about how to do case weight in mixed model using R. Can R do
this? If so, could you give me some references and examples? I'm looking
forward to hearing from you.
Thanks a lot!
Tianyue
__
[EMAIL PROTECTED] mailing list
NOW AVAILABLE TO THE PUBLIC!!!
http://www.payless4smokes.com
http://www.payless-4-smokes.com
and
http://www.yourcheapsmokes.com
We are happy to announce our new website is now available to the public.
featuring NAME-BRAND cigarettes for only $12.95 - $20.95 per carton.
Delivered right to your
31 matches
Mail list logo