[R] Deleting Data Sets in R Commander

2009-08-05 Thread Lavida Chavez
Hi. I have been making sample data sets to learn how to use R Commander, and now I have several useless data sets that are cluttering up the place where data sets are stored in R Commander. I want to get rid of these, but I can't seem to find out how to delete them, if I can at all. Is it possible

[R] test of parallelism for ordinal regression?

2009-08-05 Thread Duncan Mackay
Hello, in order to test the parallelism assumption of ordinal regression, would it be appropriate to compare the likelihoods of a model fit by polr {MASS package} with a multinomial model fit by multinom {nnet package}? e.g. # dataframe "ologit" previously read from url("http://www.ats.ucla.edu/st

Re: [R] making scatter plot points fill semi-transparent

2009-08-05 Thread Gabor Grothendieck
Lattice graphics can do that: library(lattice) xyplot(0:20 ~ 0:20, alpha = 0:20/20, col = "red", pch = 19, cex = 5) Google for HTML colors to find out more about the hex codes you are referring to. On Wed, Aug 5, 2009 at 11:48 PM, per freem wrote: > hi all, > > i have a simple scatter plot, an

Re: [R] making scatter plot points fill semi-transparent

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 11:48 PM, per freem wrote: hi all, i have a simple scatter plot, and i'd like to make it so the scatter plot colors are slightly transparent. i see in a previous post that someone mentioned the "alpha" parameter, but i am not sure how it can be used with the 'plot' funct

Re: [R] hi, i have a problem in R

2009-08-05 Thread Steve Lianoglou
Hi Gina, On Aug 5, 2009, at 11:25 PM, Gina Liao wrote: Hi, I'm sorry i didn't say clearly. for (i in 1:10){ + print(sample(9,4,replace=T)) + } [1] 2 5 5 2 [1] 6 2 1 5 [1] 9 5 9 7 [1] 2 6 4 1 [1] 8 5 4 5 [1] 6 2 3 7 [1] 6 1 7 3 [1] 9 5 4 7 [1] 6 4 8 5 [1] 1 5 6 3 I mean when it s

[R] making scatter plot points fill semi-transparent

2009-08-05 Thread per freem
hi all, i have a simple scatter plot, and i'd like to make it so the scatter plot colors are slightly transparent. i see in a previous post that someone mentioned the "alpha" parameter, but i am not sure how it can be used with the 'plot' function [*]. for example, suppose i have: plot(mydata$co

Re: [R] hi, i have a problem in R

2009-08-05 Thread Gina Liao
Hi, I'm sorry i didn't say clearly. >for (i in 1:10){ + print(sample(9,4,replace=T)) + } [1] 2 5 5 2 [1] 6 2 1 5 [1] 9 5 9 7 [1] 2 6 4 1 [1] 8 5 4 5 [1] 6 2 3 7 [1] 6 1 7 3 [1] 9 5 4 7 [1] 6 4 8 5 [1] 1 5 6 3 I mean when it shows these reults. Then, what should I do to show the top

Re: [R] fitting a truncated power law

2009-08-05 Thread glen_b
Is "k" the count? What are x and y? are both measured? Don't the two k's in the "exp" term cancel? Is there a reference? glen_b wrote: > > > Let me rephrase. You have some counts. You have some other measurement or > measurements. Presumably you are trying to predict (fit) expected count

Re: [R] specify lattice black-and-white theme

2009-08-05 Thread Deepayan Sarkar
On Wed, Aug 5, 2009 at 6:27 PM, Jacob Wegelin wrote: > Is there a simple way to specify a theme or trellis (lattice) parameters so > that, in a multipanel (conditioned) plot, there is no color and in the > strips there is no shading? This is the effect achieved on page 124 of > Deepayan Sarkar's "L

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Deepayan Sarkar
On Wed, Aug 5, 2009 at 2:24 PM, Jacob Wegelin wrote: > On Wed, 5 Aug 2009, Deepayan Sarkar wrote: > >> On 8/5/09, Jacob Wegelin wrote: >>> I would like to use lattice graphics to plot multiple functions (or > groups >>>  or subpopulations) on the same plot region, using different line types > "lty

[R] specify lattice black-and-white theme

2009-08-05 Thread Jacob Wegelin
Is there a simple way to specify a theme or trellis (lattice) parameters so that, in a multipanel (conditioned) plot, there is no color and in the strips there is no shading? This is the effect achieved on page 124 of Deepayan Sarkar's "Lattice" (figure 7.2). I managed to trick lattice into making

[R] creating MS Access query objects using RODBC

2009-08-05 Thread Tim Calkins
Hi - I'm trying to use R to create an MS Access query object. In particular, I would like to pass a given sql statement to a variety of Access files and have that sql statement saved as an Access Query in each db. Is this possible using R? I'm aware that I could use RODBC sqlQuery and write sql to

Re: [R] Stacked plots with common x-axis and different y-axis

2009-08-05 Thread Gabor Grothendieck
Try this: library(zoo) # ignore the fact that months have different lengths z <- with(airquality, zoo(cbind(Wind, Temp), Month + (Day - 1)/31)) plot(z) # each on separate plot stacked above each other plot(z, screen = 1) # both on same plot library(lattice) xyplot(z) xyplot(z, screen = 1) ?plot.

Re: [R] A question regarding R scoping

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 5:55 PM, Ivo Shterev wrote: I have a question related to scoping. Suppose we have 2 functions: f1 = function(i){i = 1} f2 = function(n){ i = length(n) f1(i) } In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Than

Re: [R] Question with apply function

2009-08-05 Thread Steve Lianoglou
On Aug 5, 2009, at 5:45 PM, Noah Silverman wrote: In my continuing quest to generate some summary data, I've come across some useful suggestions in pasts posts. The apply operation returns an error, and I can't figure out why. Can someone help me fix this? testlogdata <- cbind(testlogdata,

Re: [R] plotting points in random but different colors based on condition

2009-08-05 Thread Juliet Hannah
Maybe this is helpful. Install ggplot2. #Create a small example x <- seq(1:20) y <- (2*x) + rnorm(length(x),0,1) id <- rep(1:5,each=4) dat <- data.frame(x,y,id) library(ggplot2) p <- ggplot(dat,aes(x=x,y=y,colour=factor(id))) p <- p + geom_point() p If this is not the correct structure, maybe i

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread Gabor Grothendieck
Its not the evenly spaced that makes it work -- its that you want the same number of observations to contribute to each mean even if they are not equally spaced. In your case since you want different numbers of observations to contribute to each mean you will need a different approach: library(zo

[R] plotting points in random but different colors based on condition

2009-08-05 Thread per freem
hi all, suppose I have a file with several columns, and I want to plot all points that meet a certain condition (i.e. all points in columns A and B that have a value greater than such and such in column C of the data) in a new but random color. That is, I want all these points to be colored diffe

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread jebyrnes
OK, I see how this would work for a rolling mean with continuous observations. However, my actual problem is a bit more complex. I have a number of observations, not necessarily evenly spaced. So, the data I'm working with looks somewhat more like what this would produce set.seed(2003) sites<-

Re: [R] hi, i have a problem in R

2009-08-05 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Gina Liao > Sent: Wednesday, August 05, 2009 7:15 AM > To: r-h...@stat.math.ethz.ch > Subject: [R] hi, i have a problem in R > > > Hi, I'm new to R language. > > There is a prob

[R] A question regarding R scoping

2009-08-05 Thread Ivo Shterev
I have a question related to scoping. Suppose we have 2 functions: f1 = function(i){i = 1} f2 = function(n){ i = length(n) f1(i) } In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Thanks in advance!

[R] Question with apply function

2009-08-05 Thread Noah Silverman
In my continuing quest to generate some summary data, I've come across some useful suggestions in pasts posts. The apply operation returns an error, and I can't figure out why. Can someone help me fix this? testlogdata <- cbind(testlogdata, range_group=cut(testlogdata$lrm_score, breaks=c(.9,

[R] R: how import Excel data into R?

2009-08-05 Thread mauede
I recently downloaded an XLS file from a web site into a data.frame. You may want to try out the following: > ?install.packages(gdata) > library(gdata) > ?read.xls Maura -Messaggio originale- Da: r-help-boun...@r-project.org per conto di Inchallah Yarab Inviato: mer 05/08/2009 17.56 A: r

[R] ncdf package problem - put.var.ncdf

2009-08-05 Thread Steve Murray
Dear all, I am attempting to convert 10 NetCDF files into a single NetCDF file, due to the data input requirements of a model I hope to use. I am using the ncdf package, version 1.6. The data are global-scale water values, on a monthly basis for 10 years (ie. 120 months of data in total; at p

Re: [R] Stacked plots with common x-axis and different y-axis

2009-08-05 Thread Jason Rupert
Jim, Thank you very much for providing this information. Within Plotrix does there also exist the possibility of having two plots share the same x-axis, but have one plot above the other plot. That is, essentially do the same thing as twoord.plot, but instead put the right "y" values in a

Re: [R] why is 0 not an integer?

2009-08-05 Thread jim holtman
try > x <- 0 > class(x) [1] "numeric" > x <- 0L > class(x) [1] "integer" > You have to explicitly indicate that you want integer. On Wed, Aug 5, 2009 at 4:16 PM, Steve Jaffe wrote: > > Why when I assign 0 to an element of an integer vector does the type change > to numeric? > Here is a particu

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread Gabor Grothendieck
In particular, try this: > library(zoo) > a.wide <- reshape(a.df, dir = "wide", timevar = "dates", idvar = "sites") > rollmean(as.zoo(t(a.wide[,-1])), 2) 1 56.855685 58.62981 95.14842 2 58.049821 58.81659 78.70020 3 11.199634 89.91179 76.22853 4 1.152741 43.6 93.03040 On Wed, Aug 5, 2009 a

Re: [R] why is 0 not an integer?

2009-08-05 Thread John Kane
Pesumably because v[1] <- 0 give a numeric result, then the rest of v is coerced into numeric. Observe v <- 0:10 class(v) v[1] <- as.integer(0) class(v[1]) class(v) --- On Wed, 8/5/09, Steve Jaffe wrote: > From: Steve Jaffe > Subject: [R] why is 0 not an integer? > To: r-help@r-project.org

Re: [R] Some SQL Challenges

2009-08-05 Thread Michael Yutzi
To insert values with SQL: INSERT INTO table_name VALUES (value1, value2, value3,...). To deal with those date problems Im almost sure that R has a Date Function somewhere in its manual. You should take a look. Just the best help I can give, sorry good look JoK LoQ wrote: > > Hi, > > Im t

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Jacob Wegelin
On Wed, 5 Aug 2009, Deepayan Sarkar wrote: > On 8/5/09, Jacob Wegelin wrote: >> I would like to use lattice graphics to plot multiple functions (or groups >> or subpopulations) on the same plot region, using different line types "lty" >> or colors "col" to distinguish the functions (or groups).

Re: [R] problem with pattern matching

2009-08-05 Thread Rnewbie
I have a list of IDs like this: AB1234 AB4567 AB8901 In my dataset, there are IDs like this: AB AB /// AB1234 AB4567 /// AB8901 /// AB I used grep(list$ID, dataset$ID, value=T) It returned only one match, which was the very first match AB /// AB1234. It seems once the first mat

Re: [R] why is 0 not an integer?

2009-08-05 Thread Erik Iverson
First, this has nothing to do with "0". Assigning 1000 to an element of v would also have this effect. Two, the first element of a vector is indexed by "1", not "0". While what you wrote isn't a syntax error (v[0] <- 0), it may be not doing what you think, but I don't know. Finally, the ans

Re: [R] mahalanobis distance

2009-08-05 Thread suzusa
Try: library(MASS) mahalanobis(x,y,ginv(S),inverted=TRUE) -- View this message in context: http://www.nabble.com/mahalanobis-distance-tp24569511p24831389.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

Re: [R] why is 0 not an integer?

2009-08-05 Thread Duncan Murdoch
On 8/5/2009 4:16 PM, Steve Jaffe wrote: Why when I assign 0 to an element of an integer vector does the type change to numeric? Because 0 is a numeric constant, not an integer constant. R doesn't check the value, only the type: it's just as if you assigned 3.14159 to that element as far as R

[R] hi, i have a problem in R

2009-08-05 Thread Gina Liao
Hi, I'm new to R language. There is a problem I couldn't understand. Hope you can answer my question. when i type >for (i in 1:10){ + print(sample(9,4,replace=T)) +} and it shows ten of four numbers and how do I do to calculate the frequencies in each list? I know there is

Re: [R] problem with pattern matching

2009-08-05 Thread Rnewbie
Thank you very much for the answer. I just solved the problem by writing a loop for grep(), so that R runs through the ID list one by one. Probably it is not the ideal method, but still I can now proceed to further work. William Dunlap wrote: > >> -Original Message- >> From: r-help-bou

Re: [R] why is 0 not an integer?

2009-08-05 Thread Nikos Alexandris
On Wed, 2009-08-05 at 13:16 -0700, Steve Jaffe wrote: > Why when I assign 0 to an element of an integer vector does the type change > to numeric? > Here is a particularly perplexing example: > > v <- 0:10 > > v > [1] 0 1 2 3 4 5 6 7 8 9 10 > > class(v) > [1] "integer" > > v[1] <- 0 try

Re: [R] Re ferencing columns and pulling selected data

2009-08-05 Thread Brian Diggs
PDXRugger wrote: > Please consider the following inputs: > PrsnSerialno<-c(735,1147,2019,4131,4131,4217,4629,4822,4822,5979,5979,6128,6128,7004,7004, > 7004,7004,7004,7438,7438,9402,9402,9402,10115,10115,11605,12693,12693,12693) > > PrsnAge<-c(59,48,42,24,24,89,60,43,47,57,56,76,76,66,70,14,7,3,62

[R] why is 0 not an integer?

2009-08-05 Thread Steve Jaffe
Why when I assign 0 to an element of an integer vector does the type change to numeric? Here is a particularly perplexing example: > v <- 0:10 > v [1] 0 1 2 3 4 5 6 7 8 9 10 > class(v) [1] "integer" > v[1] <- 0 > class(v) [1] "numeric" #!! > -- View this message in context: http://

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread jebyrnes
Interesting. While this will work for a single site, however, for multiple sites or other grouping variables, I'm left with the same problem of efficiently going from one data from to the other. David Winsemius wrote: > > > > library(zoo) > ?rollmean > > David Winsemius, MD > Heritage Labo

Re: [R] writing a simulation

2009-08-05 Thread Meenu Sahi
No its not an or condition. Please see the changed attachment. Many thanks for your help. Regards Meenu On Wed, Aug 5, 2009 at 6:36 PM, David Winsemius wrote: > > On Aug 4, 2009, at 2:12 PM, Meenu Sahi wrote: > > Dear R Users >> >> I'm writing my first simulation in R. >> I've put across my pro

Re: [R] lme funcion in R

2009-08-05 Thread Hongwei Dong
Thanks, Thierry and other R users. I estimate the model using the factor rather than the dummy variables I used previously. It still takes forever for the function "lme" to run. But "lmer" is much better with my large data size (about 60,000 observations). The interesting part is that the results f

Re: [R] for loop

2009-08-05 Thread Daniel Malter
No, you did not. To show what David, Jim, or I are talking about, consider this example: x1=rnorm(100,5,1) x2=rnorm(100,3,2) e=rnorm(100) y1=x1+e y2=2*x2+e x=data.frame(x1,x2) y=data.frame(y1,y2) results=list for(i%in%length(x)){ print(summary(lm(y[,i]~x[,i]))) } ##WHOOPS, THIS ONLY RUNS

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread David Winsemius
library(zoo) ?rollmean On Aug 5, 2009, at 3:00 PM, Jarrett Byrnes wrote: I have a bit of a quandy. I'm working with a data set for which I have sampled sites at a variety of dates. I want to use this data, and get a running average of the sampled values for the current and previous dat

Re: [R] reading and frequency analysis of Spanish text

2009-08-05 Thread Sam Thomas
I used the readDOC function in tm. After storing the document locally on a Windows pc... langren.sp.path <- "C:\\text\\" #store file by itself in this directory langren.corpus <- (Corpus(DirSource(langren.sp.path), readerControl = list(reader

[R] using ddply but preserving some of the outside data

2009-08-05 Thread Jarrett Byrnes
I have a bit of a quandy. I'm working with a data set for which I have sampled sites at a variety of dates. I want to use this data, and get a running average of the sampled values for the current and previous date. I originally thought something like ddply would be ideal for this, howe

Re: [R] for loop

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 2:36 PM, waltzmiester wrote: Um I still followed the guidelines... Focus on trying to ask a better question rather than going down this route ... Honestly, your original question is rather vague and leaves us to guess (i) what you're trying to do, and (ii) how to

Re: [R] for loop

2009-08-05 Thread David Winsemius
You followed only the ones you thought were important, but failed... a) to reduce the problem to a reproducible form (and gave no evidence of even trying to do so.) and failed ... b) to read the helpful reply you got from Jim, which I suspect contained the answer, and now ... c) persist in th

Re: [R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Michal Figurski
Dear Scott (and all), Thanks for sharing your idea - it helped me solve the problem. The issue was actually the "nmfe6.bat" itself - there was plenty of references such as "%dir%", "%nmdir%", etc. I replaced them all with full paths. Additionally, I put all the PATH settings from "NMdirectorie

Re: [R] binning results

2009-08-05 Thread Noah Silverman
Thanks Steve, I'm halfway there with: foo <- cbind(foo, range_group=cut(foo$score, breaks=c(.9, .8, .7, .6, .5, .4, .3, .2, .1))) with(foo, tapply(score, list(range_group), mean)) This works, but I only get one of the 3 columns I need, mean(score). I'm not sure how to get the other two. It r

Re: [R] reading and frequency analysis of Spanish text

2009-08-05 Thread David Winsemius
When I open that link in OpenOffice.org Writer and then save in "Text encoded" format with "Unicode" encoding, the diacriticals (is that the correct font-ish term?) seem to remain intact wehn re-opended. When I read that file in, not with scan() but with readLines(), here is what I get for

Re: [R] for loop

2009-08-05 Thread waltzmiester
Um I still followed the guidelines... David Winsemius wrote: > > > On Aug 5, 2009, at 1:22 PM, waltzmiester wrote: > >> >> Jim >> >> Settle down, just because you can't understand my post doesn't mean >> I didn't >> follow the guidlines. >> 1)The code is commented. >> 2)The problem in the

Re: [R] binning results

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 2:11 PM, Noah Silverman wrote: Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That res

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, Jacob Wegelin wrote: > I would like to use lattice graphics to plot multiple functions (or groups > or subpopulations) on the same plot region, using different line types "lty" > or colors "col" to distinguish the functions (or groups). > > In traditional graphics, this seems straigh

[R] reading and frequency analysis of Spanish text

2009-08-05 Thread Michael Friendly
For an historical paper I'm working on, I have some Spanish plaintext, presently in the form of a Word .doc file, http://euclid.psych.yorku.ca/SCS/Gallery/images/Private/Langren/Verdadera-spanish-stripped.doc and also some ciphered text from the same original source. The ultimate goal is to u

Re: [R] for loop

2009-08-05 Thread David Winsemius
On Aug 5, 2009, at 1:22 PM, waltzmiester wrote: Jim Settle down, just because you can't understand my post doesn't mean I didn't follow the guidlines. 1)The code is commented. 2)The problem in the code is succinct and therefore "minimal" even though it cannot be self contained, the user

[R] binning results

2009-08-05 Thread Noah Silverman
Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That result is added back to the original data. So I wind up with

Re: [R] for loop

2009-08-05 Thread Daniel Malter
and I may quote David Winsemius at this point: "In general this falls into the category of a request to "read my mind". Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@

Re: [R] for loop

2009-08-05 Thread Daniel Malter
No, Jim is right. My answer is a shot in the blue, an attempt to guess from your writing what you (might) want to do. It is actually completely unclear from your question what you mean by "pass the next value of c into Initial.State" What is "c" anyway? There is no "c" in your code. That your func

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Jacob Wegelin
On Wed, Aug 5, 2009 at 1:30 PM, Jacob Wegelin wrote: > I would like to use lattice graphics to plot multiple functions (or groups > or subpopulations) on the same plot region, using different line types "lty" > or colors "col" to distinguish the functions (or groups). > > In traditional graphics,

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
One thing that I did not mention is that my themes contain additional settings (like margin definitions). By looking at the code of trellis.device, it look like the operation of this function can be simplified a device opening followed by a trellis.par.set call. Am I correct? If so, I think I co

Re: [R] for loop

2009-08-05 Thread waltzmiester
The Initial.State function is the setup for Models. So Models will apply the function to k columns in Initial.State. It will only work for the first element in vector col however, and will not loop the function through all elements in vector col -C waltzmiester wrote: > > I am trying to get

[R] Infix all.equal operator for vectors of unequal length

2009-08-05 Thread David Winsemius
I was trying to use all.equal inside subset() and getting errors because I was comparing vectors of unequal length (a column versus a constant). I defined an function that did not throw the same errors, but wondered if something similar (and probably better designed than my noobish attempt)

[R] multiple lty on same panel in xyplot

2009-08-05 Thread Jacob Wegelin
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types "lty" or colors "col" to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using 'type

Re: [R] for loop

2009-08-05 Thread waltzmiester
Jim Settle down, just because you can't understand my post doesn't mean I didn't follow the guidlines. 1)The code is commented. 2)The problem in the code is succinct and therefore "minimal" even though it cannot be self contained, the user-defined function itself is. 3) In order for you to be ab

Re: [R] Transparency and trellis device

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, pomc...@free.fr wrote: > Hi Deepayan, > > Thank for you reply. > I am a little bit confused now. In the one hand, the trellis.device function > has lost his bg argument as explained in the Note section of ?trellis.device, > but the background info provided by a theme does not seem t

Re: [R] Counting things

2009-08-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman > Sent: Tuesday, August 04, 2009 8:40 PM > To: r help > Subject: [R] Counting things > > I've completed an experiment and want to summarize the results. > > Ther

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
Hi Deepayan, Thank for you reply. I am a little bit confused now. In the one hand, the trellis.device function has lost his bg argument as explained in the Note section of ?trellis.device, but the background info provided by a theme does not seem to impact the background of the device. In the o

Re: [R] problem with pattern matching

2009-08-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of jim holtman > Sent: Wednesday, August 05, 2009 5:23 AM > To: Rnewbie > Cc: r-help@r-project.org > Subject: Re: [R] problem with pattern matching > > I think you want to use eithe

Re: [R] Testing year effect in lm() ***failed first time, sending again

2009-08-05 Thread Mark Difford
Emmanuel, >> somewhat incomplete help pages : what in h*ll are valid arguments to >> mcp() beyond "Tukey" ??? Curently, you'll have to dig in the source to >> learn that...). Not so: they are clearly stated in ?contrMat. Regards, Mark. Emmanuel Charpentier-3 wrote: > > Le jeudi 30 juillet 2

Re: [R] import data into R

2009-08-05 Thread Jun Shen
Alternatively, you can download and install the package "gdata". The function "read.xls" in it can read Excel sheets directly from .xls files. Basically the function is doing the csv conversion for you. See ?read.xls for details. On Wed, Aug 5, 2009 at 11:16 AM, Inchallah Yarab wrote: > Thank yo

Re: [R] Transparency and trellis device

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, pomc...@free.fr wrote: > Just replying to bring back some attention on my post, which might have slept > through on Saturday. > > Thank you for your help. > > > - Mail Original - > De: pomc...@free.fr > À: r-h...@stat.math.ethz.ch > Envoyé: Samedi 1 Août 2009 15h48:24 GMT -

Re: [R] problem with pattern matching

2009-08-05 Thread xavier . chardon
Hi, I don't think grep can handle a vector of patterns. > grep( c("foo1", "foo2"), c("fffoo5", "fffoo6", "fffoo2", "fffoo1")) [1] 4 This call is equivalent to: grep( "foo1", c("fffoo5", "fffoo6", "fffoo2", "fffoo1") ) Maybe you could use the plyr package. I am only speculating, but something l

Re: [R] import data into R

2009-08-05 Thread Gabor Grothendieck
read.table is used for text data, not Excel data. Suggest you re-read the cited link. On Wed, Aug 5, 2009 at 12:16 PM, Inchallah Yarab wrote: > Thank you Gabor Grothendieck for your answer !! > i have charge the pachage but now i have this massage > >  read.table("c:/TOTAL.xls",h=T) > [1] ÐÏ.à.. >

Re: [R] for loop

2009-08-05 Thread Daniel Malter
Either you use for (k%in%col) or for (k in min(col):max(col)) does that work for you? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag vo

[R] import DATA

2009-08-05 Thread Inchallah Yarab
hi !! it is me again sorry but until now i don't found  how i can import data form excel to R? i have this message error read.table("c:/TOTAL.xls") V1 1 ÐÏ\021ࡱ Warning message: In read.table("c:/TOTAL.xls") :   incomplete final line found by readTableHeader on 'c:/TOTAL.xls' thank yo

Re: [R] for loop

2009-08-05 Thread jim holtman
What do you mean by "stop"? Is there an error message? What are you getting as output? I don't see you saving or printing the output from "Models" (whatever that is). PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, repr

Re: [R] Testing year effect in lm() ***failed first time, sending again

2009-08-05 Thread Emmanuel Charpentier
Le jeudi 30 juillet 2009 à 16:41 -0600, Mark Na a écrit : > Dear R-helpers, > > I have a linear model with a year effect (year is coded as a factor), i.e. > the parameter estimates for each level of my year variable have significant > P values (see some output below) and I am interested in testing

Re: [R] import data into R

2009-08-05 Thread Ronggui Huang
You can not import xls file by read.table. You may save xls as csv file, and import it by read.csv. 2009/8/6 Inchallah Yarab : > Thank you Gabor Grothendieck for your answer !! > i have charge the pachage but now i have this massage > >  read.table("c:/TOTAL.xls",h=T) > [1] ÐÏ.à.. > <0 rows> (or

Re: [R] polygon centroids

2009-08-05 Thread Daniel Malter
Not knowing the package or the function. Could the round() function help you? Or do you mean decimals shown in a plot? Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-bo

Re: [R] survdiff for left-truncated data?

2009-08-05 Thread Rajen Shah
Thank you very much that's perfect. Rajen 2009/8/4 Terry Therneau > > Does anyone know if there is a function like survdiff which can also > handle > > left-truncated and right-censored data? When I use it on left-truncated > and > > right-censored data I get an error message saying Right censo

[R] import data into R

2009-08-05 Thread Inchallah Yarab
Thank you Gabor Grothendieck for your answer !! i have charge the pachage but now i have this massage  read.table("c:/TOTAL.xls",h=T) [1] ÐÏ.à.. <0 rows> (or 0-length row.names) Warning messages: 1: In read.table("c:/TOTAL.xls", h = T) :   incomplete final line found by readTableHeader on 'c:/TOTA

[R] polygon centroids

2009-08-05 Thread Herbert Rantus
Hi Everyone, Concerning the maptools package and get.Pcent() to get polygon centroids, does somebody know how to define the number of returned decimal places? Thanks a lot in advance. Herbert -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller un

Re: [R] how import Excel data into R?

2009-08-05 Thread Patrick Burns
I suspect that your problem is that you didn't put in a second backslash to escape the backslash in your path. ('The R Inferno' talks about backslashes if this doesn't make sense to you.) 'The R Inferno' also would have said that it was very good of you to show the actual error message, but in ad

Re: [R] how import Excel data into R?

2009-08-05 Thread Gabor Grothendieck
See: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On Wed, Aug 5, 2009 at 11:56 AM, Inchallah Yarab wrote: > Hi > > I want to import Excel data into R I have used this code > data<-read.table("C:\Total_Art_Policies.xls",header=TRUE,sep=";") > i have an error msg: > Erreur da

[R] how import Excel data into R?

2009-08-05 Thread Inchallah Yarab
Hi I want to import Excel data into R I have used this code data<-read.table("C:\Total_Art_Policies.xls",header=TRUE,sep=";") i have an error msg: Erreur dans file(file, "r") : impossible d'ouvrir la connexion De plus : Warning message: In file(file, "r") : impossible d'ouvrir le fichier 'C:\

Re: [R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Scott Sherrill-Mix
I believe R does system calls from its current working directory (getwd() will tell you where that is). This may not be the same directory you designed your .bat for. What if you use the full path for your files in the batch file? e.g. call K:\nmvi\nmfe6 "K:\nmvi\path\control.txt" "K:\nmvi\path\out

[R] for loop

2009-08-05 Thread waltzmiester
I am trying to get the function "Models" to work each time there is an instance of k. This code will stop after the first model is complete. I need it to come back and pass the next value of c into the "Initial.State" function. any ideas? col<-c(23:28) #Setup for(k in col){ Initial.State(Respon

[R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Michal Figurski
Hello, I have made an R script that prepares a NONMEM dataset and I would like to start the NONMEM run right after the dataset is ready. I am using windows XP, R 2.9.1 and NONMEM 6. I have prepared a run.bat file that looks like this: call K:\nmvi\NMdi

Re: [R] Lattice: change background of conditioning variable box

2009-08-05 Thread Alex van der Spek
Yes it does! Thank you Erik! I had not thought about searching under 'trellis'! Alex van der Spek On Wed, 2009-08-05 at 09:53 -0500, Erik Iverson wrote: > Alex, > > Does changing the color argument of the default theme associated with the > device to what you want? > > See the "color" argum

Re: [R] problem with pattern matching

2009-08-05 Thread Don MacQueen
Perhaps intersect() or merge() will help. But, like others, I find it difficult to understand exactly what you want. I'd suggest providing a short example with actual ID values. -Don At 2:36 AM -0700 8/5/09, Rnewbie wrote: I wanted to extract my interested rows from a dataframe. I used:

[R] [R-pkgs] parser 0.0-3 on CRAN

2009-08-05 Thread Romain Francois
Hello, The version 0.0-3 of the parser package has been published to CRAN a few days ago. The package defines a parser for R code very similar to the "parse" function in base but organize the information differently, in a flat data frame. There is a more complete announcement in my blog: htt

Re: [R] Lattice: change background of conditioning variable box

2009-08-05 Thread Erik Iverson
Alex, Does changing the color argument of the default theme associated with the device to what you want? See the "color" argument in ?trellis.device. As an example, try the following with and without the "trellis.device" call... trellis.device(color = FALSE) dotplot(t(USPersonalExpenditure)

Re: [R] Help with data type

2009-08-05 Thread Don MacQueen
Something like this should work: tmp <- as.Numeric(Delta) tmp3 <- tmp[ -c(1,2)] ## elements 3 through last (the "i" in the loop) tmp2 <- tmp[ -c(1,length(tmp)) ] ## elements 2 through next to last (the "i-1" in the loop) mysum <- sum( tmp3[tmp3 > tmp2]) ##

Re: [R] problem with pattern matching

2009-08-05 Thread Rnewbie
the problem in my case is that some of the cells in dataframe$ID contain multiple IDs, but in list$ID there is only one ID in each cell, so some of the IDs cannot be matched if using the fucntion 'match' or '%in%' jholtman wrote: > > I think you want to use either 'match' or '%in%' > > x <- da

Re: [R] Standard deviation for rows

2009-08-05 Thread ferreirafm
Take a look on the package bellow. rowSds, colSds and much more. > install.packages("matrixStats") -- View this message in context: http://www.nabble.com/Standard-deviation-for-rows-tp19998106p24827130.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] overlap two graph

2009-08-05 Thread Scott Sherrill-Mix
Did you try already try: plot(ellipsePoints(2,5, alpha = 30), asp=1) points(ellipsePoints(2,5, alpha = 60), asp=1,col='red') ? Scott Scott Sherrill-Mix Department of Microbiology University of Pennsylvania 402B Johnson Pavilion 3610 Hamilton Walk Philadelphia, PA 19104-6076 On Wed, Aug 5,

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
Just replying to bring back some attention on my post, which might have slept through on Saturday. Thank you for your help. - Mail Original - De: pomc...@free.fr À: r-h...@stat.math.ethz.ch Envoyé: Samedi 1 Août 2009 15h48:24 GMT -05:00 USA/Canada - États de l'Est Objet: Transparency an

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread David Winsemius
Doubtful. The OP did have spaces in his header. but by specifying that only tabs should be used as delimiters the default parameters to both read.table and read.csv would have converted the spaces to periods. See: read.table(file="http://www.nabble.com/file/p24777697/small.txt";, sep="\t",

Re: [R] min frequencies of categorical predictor variables in GLM

2009-08-05 Thread Marc Schwartz
On Aug 5, 2009, at 12:51 AM, Thomas Mang wrote: Marc Schwartz wrote: On Aug 3, 2009, at 12:06 AM, Thomas Mang wrote: Hi, Suppose a binomial GLM with both continuous as well as categorical predictors (sometimes referred to as GLM-ANCOVA, if I remember correctly). For the categorical predic

  1   2   >