RE: [R] Using files as connections

2003-08-29 Thread maj
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,

[R] Creating a new table from a set of constraints

2003-08-29 Thread Francisco J. Bido
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

RE: [R] Creating a new table from a set of constraints

2003-08-29 Thread Dowkiw, Arnaud
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

Re: [R] mtext / expression and font type of bold

2003-08-29 Thread Uwe Ligges
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

Re: [R] Creating a new table from a set of constraints

2003-08-29 Thread Francisco J. Bido
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-

[R] extract numerical variables from a data frame

2003-08-29 Thread Vincent Spiesser
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,

Re: [R] extract numerical variables from a data frame

2003-08-29 Thread Prof Brian Ripley
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

RE: [R] extract numerical variables from a data frame

2003-08-29 Thread Simon Fear
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

[R] What fontfamily x11() device normally uses?

2003-08-29 Thread M.Kondrin
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()

[R] levelplot behaviour when at cuts the z range

2003-08-29 Thread Edzer J. Pebesma
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

Re: [R] What fontfamily x11() device normally uses?

2003-08-29 Thread Prof Brian Ripley
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

[R] R and pointer

2003-08-29 Thread Laetitia Marisa
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.

Re: [R] R and pointer

2003-08-29 Thread Jeff Gentry
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

Re: [R] R and pointer

2003-08-29 Thread Prof Brian Ripley
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

Re: [R] Creating a new table from a set of constraints

2003-08-29 Thread Roger D. Peng
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

RE: [R] R and pointer

2003-08-29 Thread Henrik Bengtsson
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

[R] vardiag package help

2003-08-29 Thread Monica Palaseanu-Lovejoy
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

Re: [R] R and pointer

2003-08-29 Thread Barry Rowlingson
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,

RE: [R] R and pointer

2003-08-29 Thread Simon Fear
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

[R] Six axis y with axis function?

2003-08-29 Thread solares
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

Re: [R] Six axis y with axis function?

2003-08-29 Thread Spencer Graves
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)

Re: [R] levelplot behaviour when at cuts the z range

2003-08-29 Thread Deepayan Sarkar
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.

[R] Lattice plot questions

2003-08-29 Thread Paul, David A
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,

[R] difference between - and =

2003-08-29 Thread Levi Larkey
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

Re: [R] difference between - and =

2003-08-29 Thread Thomas Petzoldt
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:

Re: [R] Lattice plot questions

2003-08-29 Thread Deepayan Sarkar
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 ?

RE: [R] Lattice plot questions

2003-08-29 Thread Paul, David A
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

[R] lattice question

2003-08-29 Thread Murad Nayal
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

Re: [R] lattice question

2003-08-29 Thread Deepayan Sarkar
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,

[R] case weight in mixed model

2003-08-29 Thread tzhou1
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

[R] Cigarettes $20.95 per carton S/H Tax Included

2003-08-29 Thread payless4smokes
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