[R] average among one factor in a nested dataframe

2011-04-25 Thread Junqian Gordon Xu
I have two nested data frames: a-rnorm(6) b-rnorm(9) f1-c(x1,x2,x3)) f2-c(y1,y2) id-c(1:6) a_df-data.frame(cbind(id,f1,y1,a)) id-c(1:9) b_df-data.frame(cbind(id,f1,y2,b)) I want to preserve id and f1, but want to collapse f2 and take the corresponding mean values of a and b. Missing value in

[R] Question on Import

2011-04-25 Thread Georgina Salazar
Hi! I have the data in a tab delimited text file titled ken_data_try_anova. I tried to import it into R entering read.delim(ken_data_try_anova) but received the error message Error in read.table(file = file, header = header, sep = sep, quote = quote, : object 'ken_data_try_anova' not

Re: [R] Retrieve model from R without save

2011-04-25 Thread Raji
Hi, Thank you.I would also like to know if there is a way in which we can store R model object as a binary in memory and read the binary contents back into R model object? -- View this message in context: http://r.789695.n4.nabble.com/Retrieve-model-from-R-without-save-tp3465495p3472682.html

Re: [R] Question on Import

2011-04-25 Thread Gerrit Eichner
Hi, Georgina, using quotation marks around the file name like in read.delim( ken_data_try_anova) might help. Hth -- Gerrit On Mon, 25 Apr 2011, Georgina Salazar wrote: Hi! I have the data in a tab delimited text file titled ken_data_try_anova. I tried to import it into R entering

Re: [R] Question on Import

2011-04-25 Thread Alexander Engelhardt
Am 25.04.2011 09:58, schrieb Georgina Salazar: Hi! I have the data in a tab delimited text file titled ken_data_try_anova. I tried to import it into R entering read.delim(ken_data_try_anova) but received the error message Error in read.table(file = file, header = header, sep = sep, quote =

Re: [R] Question on Import

2011-04-25 Thread Jim Lemon
On 04/25/2011 05:58 PM, Georgina Salazar wrote: Hi! I have the data in a tab delimited text file titled ken_data_try_anova. I tried to import it into R entering read.delim(ken_data_try_anova) but received the error message Error in read.table(file = file, header = header, sep = sep, quote

Re: [R] return code 10 in the R documentation

2011-04-25 Thread peter dalgaard
On Apr 25, 2011, at 05:53 , Jim Lemon wrote: On 04/25/2011 12:26 PM, swarna14 wrote: Hi Everyone, I have group of R jobs that should be submitted to the condor when I submit the jobs to the condor, they don't run and when I checked the Sched Log files the jobs are exiting with status code

[R] Defining origin for rotation in RGL device

2011-04-25 Thread Mark Heckmann
Hi all, How can I tell RGL to set the center for the rotation to the origin of the coordinate system (0,0,0). It seems that the default is to use the center of the display not the origin of the coordinate system. open3d() lines3d(c(0, 1), c(0,0), c(0,0)) lines3d(c(0,0), c(0, 1), c(0,0))

Re: [R] Random Normal Variable Correlated to an Existing Binomial Variable

2011-04-25 Thread Petr Savicky
On Sun, Apr 24, 2011 at 07:00:26PM -0400, Shane Phillips wrote: Hi, R-Helpers! I have a dataframe that contains a binomial variable. I need to add another random variable drawn from a normal distribution with a specific mean and standard deviation. This variable also needs to be

[R] regular expression for nth character in a string

2011-04-25 Thread Gonçalo Ferraz
Hi, I have a string InTrouble and want to extract, say, the first two characters: In or the last three: blee or the 3rd, 4th, and 5th: Trou Is there an easy way of doing this quickly with regular expressions in gsub, grep or similar? Thank you for any help. Gonçalo

Re: [R] regular expression for nth character in a string

2011-04-25 Thread jim holtman
will this do it: x - InTrouble sub(^(..).*, \\1, x) # first two [1] In sub(.*(...)$, \\1, x) # last three [1] ble sub(^..(...).*, \\1, x) # 3rd,4th,5th char [1] Tro 2011/4/25 Gonçalo Ferraz gferra...@gmail.com: Hi, I have a string InTrouble and want to extract, say, the first two

Re: [R] regular expression for nth character in a string

2011-04-25 Thread Jim Lemon
On 04/25/2011 08:17 PM, Gonçalo Ferraz wrote: Hi, I have a string InTrouble and want to extract, say, the first two characters: In or the last three: blee or the 3rd, 4th, and 5th: Trou Is there an easy way of doing this quickly with regular expressions in gsub, grep or similar? Hi

Re: [R] regular expression for nth character in a string

2011-04-25 Thread David Winsemius
On Apr 25, 2011, at 6:17 AM, Gonçalo Ferraz wrote: Hi, I have a string InTrouble and want to extract, say, the first two characters: In or the last three: blee or the 3rd, 4th, and 5th: Trou Is there an easy way of doing this quickly with regular expressions in gsub, grep or similar?

Re: [R] filling array with functions

2011-04-25 Thread derek
Richard, that way I will have to write functions manually and that is not possible for large number of functions. derek -- View this message in context: http://r.789695.n4.nabble.com/filling-array-with-functions-tp3468313p3472885.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] filling array with functions

2011-04-25 Thread peter dalgaard
On Apr 25, 2011, at 12:15 , derek wrote: Richard, that way I will have to write functions manually and that is not possible for large number of functions. Well do what he means: fv - vector(list,10) for (i... { ... fv[[i]] - ... ... } (Your code still won't work as written; V[i]

Re: [R] average among one factor in a nested dataframe

2011-04-25 Thread Kenneth Roy Cabrera Torres
Hi Junquian: I try your code (there is a typo, I believe) a-rnorm(6) b-rnorm(9) f1-c(x1,x2,x3) f2-c(y1,y2) id-c(1:6) a_df-data.frame(cbind(id,f1,y1,a)) id-c(1:9) b_df-data.frame(cbind(id,f1,y2,b)) But I don't understand the nested databases. I see that both have f1 variable but I do not see f2

Re: [R] average among one factor in a nested dataframe

2011-04-25 Thread Junqian Gordon Xu
Never mind, I find a generic solution: require(reshape) melted-melt(dataframe, id=c(id,f1,f2)) averaged=cast(melted,id+f1~variable,mean) which collapses away f2, and it's easy to generalize this to collapse any factors. Thanks anyway Gordon On 4/25/11 6:14 AM, Kenneth Roy Cabrera Torres wrote:

Re: [R] regular expression for nth character in a string

2011-04-25 Thread Gabor Grothendieck
2011/4/25 Gonçalo Ferraz gferra...@gmail.com: Hi, I have a string InTrouble and want to extract, say, the first two characters: In or the last three: blee or the 3rd, 4th, and 5th: Trou Is there an easy way of doing this quickly with regular expressions in gsub, grep or similar?

Re: [R] Defining origin for rotation in RGL device

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 5:46 AM, Mark Heckmann wrote: Hi all, How can I tell RGL to set the center for the rotation to the origin of the coordinate system (0,0,0). It seems that the default is to use the center of the display not the origin of the coordinate system. open3d() lines3d(c(0, 1), c(0,0),

Re: [R] help with \ in strings

2011-04-25 Thread Nutter, Benjamin
Depending on what else you're writing around the %, you might consider using the latexTranslate() function in Hmisc. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of viostorm Sent: Sunday, April 24, 2011 8:48 AM To:

Re: [R] Using Java methods in R

2011-04-25 Thread hill0093
So the first few posts show that I found out how to get Java functions to return type double numbers to R. The arrays are still a problem. Here is another of my attempts to understand how to get java arrays into R. The Java code in class CalqsLin for an array of constants named conArr and for a

Re: [R] random typing over text

2011-04-25 Thread Kenn Konstabel
On Mon, Apr 25, 2011 at 4:22 AM, Jim Lemon j...@bitwrit.com.au wrote: On 04/24/2011 08:13 AM, derek wrote: Thank you very much. It was the Insert key. It was very annoying. Actually is this owerwrite function of any use? Hi derek, As Duncan mentioned, it is very useful when one wishes to

Re: [R] problem with library tseriesChaos

2011-04-25 Thread Fukushima Shintaro
Hello. Is it possible to determine time delay with other function's output or I can choose any random value? There are several ways to estimate time delay in chaotic time series analysis. Please refer to the book Nonlinear time series analysis by Holger Kantz and Thomas Shreiber.

[R] probit regression marginal effects

2011-04-25 Thread Quark
Dear R-community, I am currently replicating a study and obtain mostly the same results as the author. At one point, however, I calculate marginal effects that seem to be unrealistically small. I would greatly appreciate if you could have a look at my reasoning and the code below and see if I

Re: [R] Two Copies of Each Message

2011-04-25 Thread david.jessop
I have the same problem - it's happened before and then just fixed itself. But rather annoying. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas Lumley Sent: 23 April 2011 00:34 To: Stephen P Molnar Cc: R-help Subject: Re:

[R] blank space escape sequence in R?

2011-04-25 Thread Mark Heckmann
Is there a blank space escape sequence in R, i.e. something like \sp etc. to produce a blank space? TIA Mark ––– Mark Heckmann Blog: www.markheckmann.de R-Blog: http://ryouready.wordpress.com __ R-help@r-project.org

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 9:01 AM, Mark Heckmann wrote: Is there a blank space escape sequence in R, i.e. something like \sp etc. to produce a blank space? You need to give some context. A blank in a character vector will be printed as a blank, so you are probably talking about something else, but

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Mark Heckmann
I use a function that inserts line breaks (\n as escape sequence) according to some criterion when there are blanks in the string. e.g. some text \nand some more text. What I want now is another form of a blank, so my function will not insert a ”\n at that point. e.g. some text\spaceand some

Re: [R] Survival analysis: same subject with multiple treatments

2011-04-25 Thread Terry Therneau
---Begin inclusion -- I need some help to figure out what is the proper model in survival analysis for my data. Subjects were randomized to 3 treatments in trial 1, some of them experience the event during the trial; After period of time those subjects were randomized to 3 treatments again in

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 9:13 AM, Mark Heckmann wrote: I use a function that inserts line breaks (\n as escape sequence) according to some criterion when there are blanks in the string. e.g. some text \nand some more text. What I want now is another form of a blank, so my function will not insert a ”\n

[R] R workshop in Hamilton, Ontario, May 24 and 25

2011-04-25 Thread John Fox
Dear r-help list members, I'll be teaching a two-day introductory R workshop at McMaster University in Hamilton, Ontario, on May 24 and 25. The workshop will largely be based on materials from Fox and Weisberg, An R Companion to Applied Regression, Second Edition (Sage, 2011). Further information

Re: [R] random typing over text

2011-04-25 Thread peter dalgaard
On Apr 25, 2011, at 14:52 , Kenn Konstabel wrote: ... means that Windows will activate StickyKeys(TM) which will make your keyboard useless until you restart the computer. ...or, apparently, press both shift keys simultaneously, whichever comes first. Now, whoever decided that CapsLock

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Jan van der Laan
There exists a non-breaking space: http://en.wikipedia.org/wiki/Non-breaking_space Perhaps you could use this. In R on Linux under gnome-terminal I can enter it with CTRL+SHIFT+U00A0. This seems to work: it prints as a space, but is not equal to ' '. I don't know if there are any

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Jan van der Laan
There exists a non-breaking space: http://en.wikipedia.org/wiki/Non-breaking_space Perhaps you could use this. In R on Linux under gnome-terminal I can enter it with CTRL+SHIFT+U00A0. This seems to work: it prints as a space, but is not equal to ' '. I don't know if there are any

Re: [R] problem with library tseriesChaos

2011-04-25 Thread Uwe Ligges
Dear Fukushima Shintaro, please also reply to the person who asked the question (she or he might not be subscribed to the mailing list). Additionally, please always quote the original question. Other mailing list readers won't lerned from an answer without corresponding question. Thank you

Re: [R] Random Relabelling

2011-04-25 Thread kmatthews
Thanks to everyone... this helps a lot. Just a quick question about etiquette in this forum (as it my first time questioning)... are notes of gratitude usually given in these forums? On Wed, Apr 20, 2011 at 1:26 PM, jthetzel [via R] ml-node+3463799-950416470-231...@n4.nabble.com wrote: Kevin,

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Mike Miller
On Mon, 25 Apr 2011, Mark Heckmann wrote: I use a function that inserts line breaks (\n as escape sequence) according to some criterion when there are blanks in the string. e.g. some text \nand some more text. What I want now is another form of a blank, so my function will not insert a ?\n

Re: [R] filling array with functions

2011-04-25 Thread derek
Still I haven't had any luck yet. How about defining new function and its domain, is it somehow possible? Like this: a-function(x) x beolongs to natural numbers 0,100 -- View this message in context: http://r.789695.n4.nabble.com/filling-array-with-functions-tp3468313p3473300.html Sent from the

Re: [R] Questions about lrm, validate, pentrace (Re: BMA, logistic regression, odds ratio, model reduction etc)

2011-04-25 Thread Frank Harrell
You've done a lot of good work on this. Yes I would say you have moderate overfitting with the first model. The only thing that saved you from having severe overfitting is that there seems to be a signal present [I am assume this model is truly pre-specified and was not developed at all by

Re: [R] Random Relabelling

2011-04-25 Thread David Winsemius
On Apr 25, 2011, at 10:53 AM, kmatthews wrote: Thanks to everyone... this helps a lot. Just a quick question about etiquette in this forum (as it my first time questioning)... are notes of gratitude usually given in these forums? The practice varies, some people do appreciate it. Doing

[R] R equivalent to (D)QDAWO in Fortran?

2011-04-25 Thread Bao, Wenkai
Hi useRs, I have a set of fortran code that was passed down from previous students, and I am converting its algorithm into R codes. I encounter this function in Fortran (D)QDAWO, which numerically integrates a function f with a user-specified cosine or sine weight. It is used because the

[R] Problem with grid's text-based units and TrueType fonts

2011-04-25 Thread Al Roark
Hi all: I'm using grid to create a layout in R that will include text mixed with graphics. In the layout, the positions of certain graphical elements depend on the number of lines in adjacent text blocks (which will vary from case to case). I was hoping to use grid's built in functions to

Re: [R] Defining origin for rotation in RGL device

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 7:54 AM, Duncan Murdoch wrote: On 25/04/2011 5:46 AM, Mark Heckmann wrote: Hi all, How can I tell RGL to set the center for the rotation to the origin of the coordinate system (0,0,0). It seems that the default is to use the center of the display not the origin of the

Re: [R] Pass String from R to C

2011-04-25 Thread Jaimin Dave
I tried using char ** but it is printing some random string. On Sat, Apr 23, 2011 at 6:08 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 11-04-23 7:04 PM, Jaimin Dave wrote: Hi, I am using a function which accepts the string from R and prints it. But when I am calling .C(main,hello);

Re: [R] Pass String from R to C

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 12:51 PM, Jaimin Dave wrote: I tried using char ** but it is printing some random string. str is a pointer to an array of pointers to strings. That's what char** means. So you need to declare it that way, and use it that way. This works for me: File test.c: void test(char

Re: [R] Pass String from R to C

2011-04-25 Thread Duncan Murdoch
On 25/04/2011 1:03 PM, Duncan Murdoch wrote: On 25/04/2011 12:51 PM, Jaimin Dave wrote: I tried using char ** but it is printing some random string. str is a pointer to an array of pointers to strings. That's what char** means. So you need to declare it that way, and use it that way. This

Re: [R] merge with origin information in new variable names

2011-04-25 Thread Eric Fail
Is there anyone out there who can suggest a way to solve this problem? Thanks, Esben On Sun, Apr 24, 2011 at 8:53 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Merge only lets you combine two tables at a time, but it does have a suffix argument that is intended to address your concern,

[R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Christoph Jäckel
Hi Together, I have a problem with the plyr package - more precisely with the ddply function - and would be very grateful for any help. I hope the example here is precise enough for someone to identify the problem. Basically, in this step I want to identify observations that are identical in

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Matt Shotwell
You can embed hex escapes in strings (except \x00). The value(s) that you embed will depend on the character encoding used on you platform. If this is UTF-8, or some other ASCII compatible encoding, \x20 will work: foo\x20bar [1] foo bar For other locales, you might try charToRaw( ) to see the

Re: [R] merge with origin information in new variable names

2011-04-25 Thread Phil Spector
Eric - As others have said, you should change the names of the variables in the data frames before you merge them. Here's one implementation of that idea: DF.wave.1 - data.frame(id=1:10,var.A=sample(letters[1:4],10,TRUE)) DF.wave.2 -

[R] Help with objects

2011-04-25 Thread Russ Abbott
Hi all, I would appreciate some help in understanding how to find out about objects. For example, to the extent that I understand R it seems to treat everything as an object even without declaring them as objects. Everything has attributes, for example, which are like instance variables in

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Matt Shotwell
I may have misread your original email. Whether you use a hex escape or a space character, the resulting string in memory is identical: identical(a\x20b, a b) [1] TRUE But, if you were to read a file containing the six characters a \x20b (say with readLines), then the six characters would be

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Petr Savicky
On Mon, Apr 25, 2011 at 04:37:15PM +0200, Jan van der Laan wrote: There exists a non-breaking space: http://en.wikipedia.org/wiki/Non-breaking_space Perhaps you could use this. In R on Linux under gnome-terminal I can enter it with CTRL+SHIFT+U00A0. This seems to work: it prints as a

[R] extracting names from matrix according to a condition

2011-04-25 Thread ivan
Dear Community, I have a matrix with assigned colnames and rolnames as follows: AB NR0.15 0,05 AL 0,05 0,05 . .. . .. . .. I want to extract the names of the rows for which A0,1 and B0,1.

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Brian Diggs
On 4/25/2011 10:19 AM, Christoph Jäckel wrote: Hi Together, I have a problem with the plyr package - more precisely with the ddply function - and would be very grateful for any help. I hope the example here is precise enough for someone to identify the problem. Basically, in this step I want to

Re: [R] blank space escape sequence in R?

2011-04-25 Thread Mark Heckmann
Thanks, Matt! \x20 works great for me! Am 25.04.2011 um 19:42 schrieb Matt Shotwell: I may have misread your original email. Whether you use a hex escape or a space character, the resulting string in memory is identical: identical(a\x20b, a b) [1] TRUE But, if you were to read a file

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Peter Ehlers
On 2011-04-25 10:19, Christoph Jäckel wrote: Hi Together, I have a problem with the plyr package - more precisely with the ddply function - and would be very grateful for any help. I hope the example here is precise enough for someone to identify the problem. Basically, in this step I want to

Re: [R] Help with objects

2011-04-25 Thread Duncan Murdoch
Russ Abbott wrote: Hi all, I would appreciate some help in understanding how to find out about objects. For example, to the extent that I understand R it seems to treat everything as an object even without declaring them as objects. That's correct. Everything has attributes, for example,

Re: [R] extracting names from matrix according to a condition

2011-04-25 Thread Peter Ehlers
On 2011-04-25 10:58, ivan wrote: Dear Community, I have a matrix with assigned colnames and rolnames as follows: AB NR0.15 0,05 AL 0,05 0,05 . .. . .. . .. I want to extract the names

Re: [R] [SPAM] - R equivalent to (D)QDAWO in Fortran? - Found word(s) list error in the Text body

2011-04-25 Thread David Reiner
dqdawo is an IMSL routine which is similar to QUADPACK's dqawo. (The initial d is for double precision), and maybe similar to NAG's d01anf. If you search for 'imsl qdawo' you should find some more description. On the other hand, the error messages may give someone enough information to help you

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Brian Diggs Sent: Monday, April 25, 2011 11:05 AM To: christoph.jaec...@wi.tum.de Cc: r-help@r-project.org Subject:

Re: [R] extracting names from matrix according to a condition

2011-04-25 Thread ivan
thank you very much. worked great for me. On Mon, Apr 25, 2011 at 8:22 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2011-04-25 10:58, ivan wrote: Dear Community, I have a matrix with assigned colnames and rolnames as follows:             A            B NR    0.15      0,05 AL     0,05  

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Brian Diggs
On 4/25/2011 11:55 AM, William Dunlap wrote: Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Brian Diggs Sent: Monday, April 25, 2011 11:05 AM To:

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Hadley Wickham
If you need plyr for other tasks you ought to use a different class for your date data (or wait until plyr can deal with POSIXlt objects). How do you get POSIXlt objects into a data frame? df - data.frame(x = as.POSIXlt(as.Date(c(2008-01-01 str(df) 'data.frame': 1 obs. of 1 variable:

[R] Generalized Linear Model

2011-04-25 Thread Megan
Hello, I am trying to run a generalized linear model but do not know where to begin. I have attached my data to R but do not know where to go from there. I have two independent variables (each has two factors associated with them) and two dependent variables, each with either a yes/no response

Re: [R] Help needed!

2011-04-25 Thread shuangyan
Hello, i got this package from the paper: Nonparametric Covariance Function estimation for Functional and Longitudinal data. http://stat.wharton.upenn.edu/~tcai/paper/html/Covariance-Function.html. Thanks lot! -- View this message in context:

[R] About How to check if a html directory exists

2011-04-25 Thread Wendy Han
Dear all, I want to let R automatically download available files from a website in certain folders. Since the files I need, if exist, are in a certain directory, I used download.file() function with a predesigned directory. However, some of the folders do not have the file I want. When this

[R] Factor function

2011-04-25 Thread Lisa
Dear All, I just want to remove “NA” from the levels of a factor. For example: d-data.frame(matrix(c(ww,ww,xx,yy,ww,yy,xx,yy,NA), ncol=3, byrow=TRUE)) factor(d[, 3], exclude=NA) [1] xx yy NA Levels: NA xx yy But “NA” is still listed in the levels. How can I solve this problem? Thanks in

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Christoph Jäckel
Hi together, thank you so much for your help! The problem was indeed the strptime-function. Replacing that with as.Date solves the problem, both in the example I provided and in my actual data set. I think this is a lesson for me to not use types I'm not really familiar with (POSIXlt in this

Re: [R] Factor function

2011-04-25 Thread Ista Zahn
Hi Lisa, NA != NA The first represents a missing observation, the second represents a character string. HTH, Ista On Mon, Apr 25, 2011 at 3:53 PM, Lisa lisa...@gmail.com wrote: Dear All, I just want to remove “NA” from the levels of a factor.  For example:

Re: [R] Generalized Linear Model

2011-04-25 Thread Alexander Engelhardt
Am 25.04.2011 21:28, schrieb Megan: Hello, I am trying to run a generalized linear model but do not know where to begin. I have attached my data to R but do not know where to go from there. I have two independent variables (each has two factors associated with them) What do you mean by this?

Re: [R] Generalized Linear Model

2011-04-25 Thread Kehl Dániel
Hi! Try to read about the glm function, type: ?glm in your R editor. It looks like you have contingency tables, maybe a loglin model would be good to start with. D 2011-04-25 12:28 keltezéssel, Megan írta: Hello, I am trying to run a generalized linear model but do not know where to

[R] My code is too loopy

2011-04-25 Thread Dimitri Liakhovitski
Hello! I wrote a piece of code below that does the job but seems too loopy to me. I was wondering if there is any way to make it more efficient/less loopy? Thanks a lot for your hints! Dimitri ### Creating example data set: mygroups-c(rep(group1, 8),rep(group2, 8))

Re: [R] Factor function

2011-04-25 Thread Lisa
Did you see the data frame d? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Factor-function-tp3473984p3474065.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Factor function

2011-04-25 Thread Ista Zahn
Yes... did you understand that NA is not equal to NA? Best, Ista On Mon, Apr 25, 2011 at 4:31 PM, Lisa lisa...@gmail.com wrote: Did you see the data frame d? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Factor-function-tp3473984p3474065.html Sent from the R help

Re: [R] Factor function

2011-04-25 Thread Lisa
Thank you for your reply again. I really know that NA is not NA. I just want to figure out how to remove NA from the levels. Thanks again. -- View this message in context: http://r.789695.n4.nabble.com/Factor-function-tp3473984p3474127.html Sent from the R help mailing list archive at

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Brian Diggs
On 4/25/2011 1:07 PM, Hadley Wickham wrote: If you need plyr for other tasks you ought to use a different class for your date data (or wait until plyr can deal with POSIXlt objects). How do you get POSIXlt objects into a data frame? df- data.frame(x = as.POSIXlt(as.Date(c(2008-01-01

[R] [R-pkgs] Rook: software and specification for R web applications and servers

2011-04-25 Thread Jeffrey Horner
Dear useRs, Rook is a new package that does three things: - It provides a way to run R web applications on your desktop with the new internal R web server named Rhttpd. Please see the Rhttpd help page. - It provides a set of reference classes you can use to write you R web applications.

Re: [R] Factor function

2011-04-25 Thread Petr Savicky
On Mon, Apr 25, 2011 at 12:53:40PM -0700, Lisa wrote: Dear All, I just want to remove “NA” from the levels of a factor. For example: d-data.frame(matrix(c(ww,ww,xx,yy,ww,yy,xx,yy,NA), ncol=3, byrow=TRUE)) factor(d[, 3], exclude=NA) [1] xx yy NA Levels: NA xx yy But “NA” is still

[R] split data frame by factor

2011-04-25 Thread ivan
Dear Community, I have a dataframe like this one: A B 5 1 6 1 7 1 8 1 9 2 10 2 11 2 12 2 I have a problem splitting up the above data frame in respect to the factor represented by B, whereas the resulting vector should contain the numeric

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Peter Ehlers
On 2011-04-25 13:07, Hadley Wickham wrote: If you need plyr for other tasks you ought to use a different class for your date data (or wait until plyr can deal with POSIXlt objects). How do you get POSIXlt objects into a data frame? df- data.frame(x = as.POSIXlt(as.Date(c(2008-01-01

Re: [R] split data frame by factor

2011-04-25 Thread ivan
sorry, the problem has been solved. On Mon, Apr 25, 2011 at 11:28 PM, ivan i.pet...@gmail.com wrote: Dear Community, I have a dataframe like this one: A       B 5       1 6       1 7       1 8       1 9       2 10      2 11      2 12      2 I have a problem splitting up the above

Re: [R] My code is too loopy

2011-04-25 Thread Dennis Murphy
Hi: I think the embed() function is your friend here. From its help page example, x - 1:10 embed (x, 3) [,1] [,2] [,3] [1,]321 [2,]432 [3,]543 [4,]654 [5,]765 [6,]876 [7,]987 [8,] 1098 Applying

Re: [R] Factor function

2011-04-25 Thread Lisa
Thank you for your help. Your R code works well. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Factor-function-tp3473984p3474196.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Abraham Mathew
Hello folks, Here's is info on what system I'm working on. sessionInfo() R version 2.13.0 (2011-04-13) Platform: i686-pc-linux-gnu (32-bit) I'm trying to install the XML package. However, I end up with the following error message. install.packages(XML) checking for xml2-config... no

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Phil Spector
Abraham - sudo apt-get install libxml2-dev is what you need to get the development libraries and xml2-config installed on your Ubuntu machine. - Phil On Mon, 25 Apr 2011, Abraham Mathew wrote: Hello folks, Here's is info on what system I'm

Re: [R] About How to check if a html directory exists

2011-04-25 Thread Rolf Turner
On 26/04/11 05:52, Wendy Han wrote: Dear all, I want to let R automatically download available files from a website in certain folders. Since the files I need, if exist, are in a certain directory, I used download.file() function with a predesigned directory. However, some of the folders do

Re: [R] About How to check if a html directory exists

2011-04-25 Thread Jerome Asselin
On Mon, 2011-04-25 at 12:52 -0500, Wendy Han wrote: I want to let R automatically download available files from a website in certain folders. Since the files I need, if exist, are in a certain directory, I used download.file() function with a predesigned directory. However, some of the folders

Re: [R] About How to check if a html directory exists

2011-04-25 Thread William Dunlap
Use try() or tryCatch() to let your loop continue looking for more files after download.file() throws an error. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rolf

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Phil Spector
sudo apt-get install libcurl4-openssl-dev - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Dirk Eddelbuettel
On 25 April 2011 at 17:39, Abraham Mathew wrote: | Hello folks, | | | Here's is info on what system I'm working on. | sessionInfo() | R version 2.13.0 (2011-04-13) | Platform: i686-pc-linux-gnu (32-bit) | | | I'm trying to install the XML package. However, I end up with the following | error

[R] Trouble Passing a for loop variable (iteration #) to a data frame

2011-04-25 Thread Galen Moore
Greetings - I am working on a piece of code to simulate vehicle times in and out in each of a number of parking spaces. At this stage, my code basically does what it is supposed to do but for the sequential number of each new parking event for a given space (i.e., the index of the loop

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Abraham Mathew
This is kind of a second question (yeah, I know), but I also get a similar error when I try to install the RCurl package * installing *source* package ‘RCurl’ ... checking for curl-config... no Cannot find curl-config ERROR: configuration failed for package ‘RCurl’ * removing

Re: [R] Trouble Passing a for loop variable (iteration #) to a data frame

2011-04-25 Thread Peter Langfelder
You need to index the variable iter: instead of iter = x[i], say iter[i] = x[i]. But a better solution is to simply say iter = x at the beginning and don't update it in the loop. The way your code is written, iter just holds the last x[i], and the last x[i] at the end of each loop is 4.

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Rolf Turner
On 26/04/11 10:46, Dirk Eddelbuettel wrote: On 25 April 2011 at 17:39, Abraham Mathew wrote: | Hello folks, | | | Here's is info on what system I'm working on. | sessionInfo() | R version 2.13.0 (2011-04-13) | Platform: i686-pc-linux-gnu (32-bit) | | | I'm trying to install the XML package.

Re: [R] Shouldn't this be fixed in the documentation? No.

2011-04-25 Thread David Winsemius
csmark wrote: I know I'm bringing up an old thread but I ran into this exact same problem. It comes straight out of section 3.3 Getting Setting Attributes from An Introduction to R documentation. http://cran.r-project.org/doc/manuals/R-intro.html#Getting-and-setting-attributes

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Jim Lemon
On 04/26/2011 09:19 AM, Rolf Turner wrote: ... So either something's not working properly or I'm still not understanding what I should be doing. Enlightenment? When the sender and the receiver understand what is being said, that is communication. When the sender understands, but the receiver

Re: [R] Random Relabelling

2011-04-25 Thread John Kane
--- On Mon, 4/25/11, kmatthews kevin-matth...@uiowa.edu wrote: From: kmatthews kevin-matth...@uiowa.edu Subject: Re: [R] Random Relabelling To: r-help@r-project.org Received: Monday, April 25, 2011, 10:53 AM Thanks to everyone... this helps a lot.  Just a quick question about etiquette

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Ben Tupper
Hi, On Apr 25, 2011, at 6:38 PM, Abraham Mathew wrote: This is kind of a second question (yeah, I know), but I also get a similar error when I try to install the RCurl package * installing *source* package ‘RCurl’ ... checking for curl-config... no Cannot find curl-config ERROR:

Re: [R] Trouble Passing a for loop variable (iteration #) to a data frame

2011-04-25 Thread Galen Moore
Thank you very much, Peter. The iter[i] = x[i] solution worked perfectly. Galen -Original Message- From: Peter Langfelder [mailto:peter.langfel...@gmail.com] Sent: Monday, April 25, 2011 17:07 To: galen.a.mo...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] Trouble Passing a for

  1   2   >