Re: [R] Concatenation

2010-05-20 Thread santana sarma
Ok -let's forget about the dataframe. Say, I have this (huge) spreadsheet that has some rows and columns, with unique rownames and column names. Using R, I wish to FINALLY have a spreadsheet where the values of the first 10 rows remain in a single row. And, the values of the next 10 rows remain i

Re: [R] Comparing three groups, data: present, absent

2010-05-20 Thread Wu Gong
## Dung observations ## Create a sample original data data <- data.frame(Species=sample(c("W", "G", "R"), 200, replace=TRUE), Age=sample(c("days", "weeks", "months"),200,replace=TRUE), Termites=sample(c(0,1),200,replace=TRUE)) ## Show what original data look like head(data) Spe

Re: [R] help to indexing data frame

2010-05-20 Thread Mohan L
On Fri, May 21, 2010 at 11:27 AM, Mohan L wrote: > > Dear All, > > I have data some thing like this: > > > sample > StateJan Feb Mar > A 1 1 1 > B1298 12931294 > C00 0 > D55 5 > E 18 18

[R] help to indexing data frame

2010-05-20 Thread Mohan L
Dear All, I have data some thing like this: > sample StateJan Feb Mar A 1 1 1 B1298 12931294 C00 0 D55 5 E 18 18 18 I need to multiply "Jan" column *1000 and divided by the same num

Re: [R] Concatenation

2010-05-20 Thread Shi, Tao
Still not clear. Follow the posting guide and some examples always help. Not sure how you "concatenate" numbers? You can try, for example, apply(df[1:10,], 2, paste, collapse=" ") but this will turn everything into strings. Is this what you want? ..Tao - Original Message > Fr

Re: [R] sort a data.frame

2010-05-20 Thread Yuan Jian
it's a excellent solution. I am sorry I missed something in my question. the column b consists of not only number but also one letter after "chr", for example chrX, chrY. I want to put them after number but in the order of ASCII. i.e. chr1 wrote: From: Jorge Ivan Velez Subject: Re: [R] sort a da

[R] Discriminative power (Trennschärfe) calc ulations with R

2010-05-20 Thread Markus Nenniger
Hi, currently, i am a bit lost. i want to calculate the discriminative power of items in my questionnaire. i have found the psych package which should contain that sort of thing, but i cant find it in there. by what name does it go? it probably does not help that i have got onlygerman books on the

Re: [R] Concatenation

2010-05-20 Thread santana sarma
Hi David, SORRY - I am trying to be more clearer this time. Let's say the dataframe has some rows and columns, with unique rownames and column names. The rest of the data in the dataframe are just numbers. I wish to concatenate those rows. That means : I wish to concatenate first 10 rows' values

Re: [R] Concatenation

2010-05-20 Thread David Winsemius
On May 20, 2010, at 11:05 PM, santana sarma wrote: Hi, I have a dataframe with some 800 rows and 14 columns. Could you please advise how I can concatenate the rows - one after another. Similarly for columns, one below the other. Not sure exactly what you are after: unlist might accompl

[R] Concatenation

2010-05-20 Thread santana sarma
Hi, I have a dataframe with some 800 rows and 14 columns. Could you please advise how I can concatenate the rows - one after another. Similarly for columns, one below the other. Many thanks. Cheers, Santana [[alternative HTML version deleted]] ___

Re: [R] sort a data.frame

2010-05-20 Thread Jorge Ivan Velez
Hi Yuan, One way would be: dd[order(factor(substring(dd$b, 4), levels = c(1:22, LETTERS[1:25]))),] HTH, Jorge On Thu, May 20, 2010 at 10:18 PM, Yuan Jian <> wrote: > it's a excellent solution. I am sorry I missed something in my question. > the column b consists of not only number but also on

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread Gabor Grothendieck
Try this one liner. The first argument of rep is the sorted intersection and the second argument is the calculated from the parallel minimum of the counts of elements in a that are also in b and the counts of elements in b that are also in a. rep(sort(intersect(a, b)), pmin(table(a[a %in% b]), ta

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread David Winsemius
On May 20, 2010, at 7:10 PM, David Winsemius wrote: On May 20, 2010, at 6:24 PM, Jonathan wrote: Thanks, but that doesn't quite work, since I'd want the result of b[b %in% a] to be symmetric with a[a%in%b] (so if there are two 2's in EACH vector, I'll get two 2's in the result, but if there

Re: [R] R GUI using traitr to display multiple data

2010-05-20 Thread j verzani
Amitoj S. Chopra gmail.com> writes: > > > Hello to everyone. > > I am constructing a GUI table using traitr with multiple buttons that > respond to different codes. Such as I am doing titration of a protein, and I > want the script to run and then the end to be displayed in a window. The > win

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread David Winsemius
On May 20, 2010, at 7:30 PM, Nordlund, Dan (DSHS/RDA) wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jonathan Sent: Thursday, May 20, 2010 3:25 PM To: David Winsemius Cc: r-help Subject: Re: [R] intersect() without discar

Re: [R] How to extract rows from data frame based on unique variable groupings

2010-05-20 Thread Wu Gong
I hope this is what you want. ## Exclude replicated rows (DF1 <- unique(DF)) ## Sort the data (DF2 <- DF1[order(DF1$V1, DF1$V2, DF1$V3, DF1$V4),]) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/How-to-extract-rows-from-data-frame-based-on-unique-variable-gro

Re: [R] Dealing with 1000+ sequentially named vectors

2010-05-20 Thread Q
Thanks a lot! This has helped send me in the right direction. I'm not used to think outside of the loop. -- View this message in context: http://r.789695.n4.nabble.com/Dealing-with-1000-sequentially-named-vectors-tp2221942p2225360.html Sent from the R help mailing list archive at Nabble.com.

[R] R GUI using traitr to display multiple data

2010-05-20 Thread Amitoj S. Chopra
Hello to everyone. I am constructing a GUI table using traitr with multiple buttons that respond to different codes. Such as I am doing titration of a protein, and I want the script to run and then the end to be displayed in a window. The window will have a button for data and graphs, where when

Re: [R] R newbie | sapply and FUN error

2010-05-20 Thread Dennis Murphy
Hi: To illustrate the idea of vectorization that the previous posters raised, here's a quick example of finding the z-scores that you requested: # Define a vectorized function to do the standardization - the argument # x below is a vector. We'll keep it simple and ignore the possibility of # miss

Re: [R] sort a data.frame

2010-05-20 Thread Dejian Zhao
If you want to sort the data frame according to column "b", the followding code does this work. attach(dd) dd<-dd[order(b),] detach(dd) If you want to sort the data frame according to the chr number in column b, you should extract the numbers first into a vector, say chrnum, and then use order

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jonathan > Sent: Thursday, May 20, 2010 3:25 PM > To: David Winsemius > Cc: r-help > Subject: Re: [R] intersect() without discarding duplicates? > > Thanks, but that doesn't quit

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread David Winsemius
On May 20, 2010, at 6:24 PM, Jonathan wrote: > Thanks, but that doesn't quite work, since I'd want the result of > b[b %in% a] to be symmetric with a[a%in%b] (so if there are two 2's > in EACH vector, I'll get two 2's in the result, but if there are two > 2's in only one vector, but one two

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread Jonathan
Thanks, but that doesn't quite work, since I'd want the result of b[b %in% a] to be symmetric with a[a%in%b] (so if there are two 2's in EACH vector, I'll get two 2's in the result, but if there are two 2's in only one vector, but one two in the other, the result will show only one 2. Consider: >

Re: [R] R newbie | sapply and FUN error

2010-05-20 Thread Marc Schwartz
On May 20, 2010, at 4:42 PM, egc wrote: > Greetings - > > While I've used R a fair bit for basic statistical machinations, I've > not used it for data manipulation - I've used SAS for 20+ years (and > SAS real shines in data handling). So, I've started the process of > trying to figure out 'how t

Re: [R] R newbie | sapply and FUN error

2010-05-20 Thread David Winsemius
On May 20, 2010, at 5:42 PM, egc wrote: Greetings - While I've used R a fair bit for basic statistical machinations, I've not used it for data manipulation - I've used SAS for 20+ years (and SAS real shines in data handling). So, I've started the process of trying to figure out 'how to do in R

Re: [R] intersect() without discarding duplicates?

2010-05-20 Thread David Winsemius
On May 20, 2010, at 5:58 PM, Jonathan wrote: Hi all, The ?intersect entry kindly points out that it discards duplicate entries. I'm looking, however, to get the intersection while KEEPING duplicate entries, and there are no instructions on how to accomplish this using intersect(). Does a

[R] intersect() without discarding duplicates?

2010-05-20 Thread Jonathan
Hi all, The ?intersect entry kindly points out that it discards duplicate entries. I'm looking, however, to get the intersection while KEEPING duplicate entries, and there are no instructions on how to accomplish this using intersect(). Does anybody have any idea how this might be done, or am

Re: [R] colored venn diagram

2010-05-20 Thread Shi, Tao
Thank you for the suggestions, Peter and David! - Original Message > From: Peter Ehlers > To: David Winsemius > Cc: "Shi, Tao" ; r-help@r-project.org > Sent: Wed, May 19, 2010 8:45:24 PM > Subject: Re: [R] colored venn diagram > > Tao, You might also have a look at the venneuler pa

[R] R newbie | sapply and FUN error

2010-05-20 Thread egc
Greetings - While I've used R a fair bit for basic statistical machinations, I've not used it for data manipulation - I've used SAS for 20+ years (and SAS real shines in data handling). So, I've started the process of trying to figure out 'how to do in R what I can do in my sleep in SAS' - specifi

[R] correlation in glm residuals

2010-05-20 Thread Bond, Stephen
Is there a library dealing with correlation in the residuals of a glm? I have bin3alt <-glm(respalt~ t+sn+c5.vrm,data=dfalt,family="quasibinomial") > bin3alt Call: glm(formula = respalt ~ t + sn + c5.vrm, family = "quasibinomial", data = dfalt) Coefficients: (Intercept) t2

Re: [R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-20 Thread David Winsemius
On May 20, 2010, at 4:47 PM, David Winsemius wrote: On May 20, 2010, at 4:44 PM, David Winsemius wrote: On May 20, 2010, at 4:32 PM, David Winsemius wrote: On May 20, 2010, at 11:24 AM, Sabatier, Jennifer F. (CDC/OID/ NCHHSTP) wrote: Hi R-help, I posted about this late yesterday bu

Re: [R] reshaping data

2010-05-20 Thread Henrique Dallazuanna
Try this: x_long <- reshape(x, direction = 'long', varying = 2:4, sep = '', idvar = 'V1', timevar = 'V') subset(x_long[order(x_long$V1),], V != "") On Thu, May 20, 2010 at 2:13 PM, Mia Bengtsson wrote: > Hello, > > I am a relatively new R-user who has a lot to learn. I have a large dataset > tha

Re: [R] lines on plot

2010-05-20 Thread Anthony Lopez
worked perfectly. kia ora! :) On Thu, May 20, 2010 at 1:19 PM, Peter Alspach < peter.alsp...@plantandfood.co.nz> wrote: > Tena koe Anthony > > You could try: > > segments(rep(0,6), 2:7, rep(2.3, 6), 2:7) > > HTH ... > > Peter Alspach > > > -Original Message- > > From: r-help-boun...@r-p

[R] (no subject)

2010-05-20 Thread ian kennedy
Here's another possibility: > x <- c("Apple12","HP42","Dell91") > strsplit(x,"(?<=\\D)(?=\\d)", perl=TRUE) [[1]] [1] "Apple" "12" [[2]] [1] "HP" "42" [[3]] [1] "Dell" "91" Krishna Tateneni writes: > Greetings, > > I have a vector of values that are a word followed by a number, e.g.,

Re: [R] writing function

2010-05-20 Thread Wu Gong
## Create a function to assign a series of values to a list of objects ## The assign function can only assign one value (could be a vector) to a name ## Set the environment to be global, otherwise the objects can't be used outside the function ## List objects that have been created toto <- functi

Re: [R] lines on plot

2010-05-20 Thread Anthony Lopez
thanks! I figured there had to be an argument for it. I was surprised at not seeing anything in par, but obviously didn't read closely enough. thanks, and apologies On Thu, May 20, 2010 at 1:23 PM, Allan Engelhardt wrote: > Some variation around > > axis(2,at=2:7,lab=c("2","3","4","5","6","7"

Re: [R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-20 Thread David Winsemius
On May 20, 2010, at 4:44 PM, David Winsemius wrote: On May 20, 2010, at 4:32 PM, David Winsemius wrote: On May 20, 2010, at 11:24 AM, Sabatier, Jennifer F. (CDC/OID/ NCHHSTP) wrote: Hi R-help, I posted about this late yesterday but got no response. I may have put TMI in the original

Re: [R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-20 Thread David Winsemius
On May 20, 2010, at 4:32 PM, David Winsemius wrote: On May 20, 2010, at 11:24 AM, Sabatier, Jennifer F. (CDC/OID/ NCHHSTP) wrote: Hi R-help, I posted about this late yesterday but got no response. I may have put TMI in the original request. Not to mention I couldn't cut and paste yes

Re: [R] lines on plot

2010-05-20 Thread Sean Anderson
On 2010-05-20, at 2:38 PM, Anthony Lopez wrote: > Is there an easier way to make this graph *without* having to specify all of > the separate segment arguments at the end? > ... > axis(2,at=2:7,lab=c("2","3","4","5","6","7")) > segments(0,2,2.3,2) > segments(0,3,2.3,3) > segments(0,4,2.3,4) > segm

[R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-20 Thread David Winsemius
On May 20, 2010, at 11:24 AM, Sabatier, Jennifer F. (CDC/OID/NCHHSTP) wrote: Hi R-help, I posted about this late yesterday but got no response. I may have put TMI in the original request. Not to mention I couldn't cut and paste yesterday because I was working R off a non-network computer

Re: [R] lines on plot

2010-05-20 Thread Allan Engelhardt
Some variation around axis(2,at=2:7,lab=c("2","3","4","5","6","7"), tck=1) should do it? See tck in help("par"). Hope this helps. Allan. On 20/05/10 18:38, Anthony Lopez wrote: Is there an easier way to make this graph *without* having to specify all of the separate segment arguments at the

Re: [R] How to extract rows from data frame based on unique variable groupings

2010-05-20 Thread Peter Alspach
Tena koe Mike duplicated() might be what you require. HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Michael H > Sent: Friday, 21 May 2010 6:37 a.m. > To: r-help@r-project.org > Subject: [R] How to ex

Re: [R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-20 Thread Brian Diggs
On 5/20/2010 9:59 AM, Julian Burgos wrote: Hi Jim I´m using R 2.11.0, on Windows XP. For what it is worth, it works fine for me, too. R 2.11.0 on Windows XP Pro. My gut instinct is to check that time3 and time4 are really what you think they are. If that is not it, post the results of dpu

Re: [R] Trailing zero's missing from signif function ?

2010-05-20 Thread RICHARD M. HEIBERGER
format(1.4, nsmall=2) Rich [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

Re: [R] lines on plot

2010-05-20 Thread Peter Alspach
Tena koe Anthony You could try: segments(rep(0,6), 2:7, rep(2.3, 6), 2:7) HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Anthony Lopez > Sent: Friday, 21 May 2010 5:39 a.m. > To: R-help@r-project.org

[R] R/UNIX consultant needed

2010-05-20 Thread Michael Lorber
Dear R-Help members, We're looking for a consultant with expertise in *R *and *UNIX*. Could it be you or someone you know? We're trying to fill the gap of a consultant who recently left our group and who wrote some code in need of revision. It would be a paying job (negotiable) and one that I bel

[R] How to extract rows from data frame based on unique variable groupings

2010-05-20 Thread Michael H
R community, I would like to know how to extract rows from a data frame (DF) such that each row in the new data frame (D.F) represents the first instance of a unique variable pairing in the original dataframe (ordered first by variable V1 then by variable V2). The unique function does not se

[R] reshaping data

2010-05-20 Thread Mia Bengtsson
Hello, I am a relatively new R-user who has a lot to learn. I have a large dataset that is in the following dataframe format: red A B C green D blueE F Where red, green and blue are "species" names and A, B and C are observations (corresponding to DNA sequen

[R] ERROR: cannot allocate vector of size?

2010-05-20 Thread Yesha Patel
I've looked through all of the posts about this issue (and there are plenty!) but I am still unable to solve the error. ERROR: cannot allocate vector of size 455 Mb I am using R 2.6.2 - x86_64 on a Linux x86_64 Redhat cluster system. When I log in, based on the specs I provide [qsub -I -X -l arch

[R] Error in unzip(zipfile = file.path(lib, pkg, "output", "R2HTMLstuff.zip"), ....

2010-05-20 Thread yjmha69
Hi there, I've a very simple R code: library(foreign) library(R2HTML) a<-read.xport("D:\\Inetpub\\wwwroot\\Rscript\\class.xpt") HTML(a,"D:\\Inetpub\\wwwroot\\Rscript\\class.html") When I run it interactive or in batch, I get the class.html file. Everything looks fine. But once it is used in my

[R] lines on plot

2010-05-20 Thread Anthony Lopez
Is there an easier way to make this graph *without* having to specify all of the separate segment arguments at the end? > x <- c(1,2) > off <- c(4,5.5) > def <- c(5.5,5.9) > par(fg="lightblue4") > plot(x,off,type="o",col="dodgerblue4",ylim=c(2,7),xlim=c(0.7,2.3),axes=F,xlab="Labor Condition",ylab=

Re: [R] Regarding the 'R' Load Command

2010-05-20 Thread Godavarthi, Murali
Hi Gavin, Steve Tons and tons of Thanks! This solved my problem. My sample data differed from the original working testdata in the factor levels. Once I set the levels using the command given by Gavin, things started working like magic. Hurray! I learned a great deal from you'll. Thank You for h

Re: [R] Svy function doesn't work nested in user-defined function

2010-05-20 Thread David Freedman
I'm not sure that this is the problem, but are you certain that the variable 'con' is in audit ? You check outside the function just really tells you that X and SEX are in audit. hth, david freedman (good to see another CDCer using R) -- View this message in context: http://r.789695.n4.nabble.

Re: [R] Trailing zero's missing from signif function ?

2010-05-20 Thread Henrique Dallazuanna
Try this: sprintf('%.2f', 1.4) On Thu, May 20, 2010 at 4:58 PM, Paul wrote: > Hello. > > In my opinion the function > > signif(1.4,digits=3) > > should give 1.40 > > but actually gives 1.4. Is there a magic way to add the trailing digits > back (and converting to chracter at the same time ?) >

[R] Trailing zero's missing from signif function ?

2010-05-20 Thread Paul
Hello. In my opinion the function signif(1.4,digits=3) should give 1.40 but actually gives 1.4. Is there a magic way to add the trailing digits back (and converting to chracter at the same time ?) Regards, Paul. __ R-help@r-project.org mailing

Re: [R] max number from a list of numbers

2010-05-20 Thread Ted Harding
On 20-May-10 19:29:31, Jonathan wrote: > Hi all, > I'm hoping this question has a simple answer, but I can't find it > through searching or trying commands. > > I have a list of numeric vectors called 'husk'. I'd just like to > treat the set of all numbers from all vectors in the list as if > it w

Re: [R] max number from a list of numbers

2010-05-20 Thread Joshua Wiley
Hello Jonathan, Look at ?sapply Does something like this do what you want? max(sapply(yourlist, max)) Josh On Thu, May 20, 2010 at 12:29 PM, Jonathan wrote: > Hi all, >   I'm hoping this question has a simple answer, but I can't find it through > searching or trying commands. > > I have a li

Re: [R] max number from a list of numbers

2010-05-20 Thread Erik Iverson
You have a list that you want to treat as a vector, so ?unlist it. Jonathan wrote: Hi all, I'm hoping this question has a simple answer, but I can't find it through searching or trying commands. I have a list of numeric vectors called 'husk'. I'd just like to treat the set of all numbers fr

Re: [R] max number from a list of numbers

2010-05-20 Thread Bryan Hanson
I think you want unlist with recursive = TRUE, see ?unlist. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 5/20/10 3:29 PM, "Jonathan" wrote: > Hi all, >I'm hoping this question has a simple answer, but I can't

[R] max number from a list of numbers

2010-05-20 Thread Jonathan
Hi all, I'm hoping this question has a simple answer, but I can't find it through searching or trying commands. I have a list of numeric vectors called 'husk'. I'd just like to treat the set of all numbers from all vectors in the list as if it were one large vector, because I'd like to extract

Re: [R] writing function

2010-05-20 Thread Joshua Wiley
Hello, I am guessing by my environment you mean the global environment (where you normally assign things from the console). It also looks like you would like the results of your function call to be a set of new objects created. If that is what you are looking for, try: toto <- function(x,y) { f

Re: [R] writing function

2010-05-20 Thread Ivan Calandra
Hi Tal, You're probably right, but I think it's never a waste to get diverse solutions :) Cheers, Ivan Le 20 mai 2010 à 19:26, Tal Galili a écrit : > Hi Ivan, > > I am not sure if the poster (arnaud) intended for a list() object (although > that's what he wrote, I suspect he intended for a

[R] Installation problem with "geepack"

2010-05-20 Thread Xianming Tan
Hi there, I just installed the package under windows, and it works very well. However, as I tried to install it on a cluster which uses linux OS, "Linux lionxc.aset.psu.edu 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux" I always failed. The message during

Re: [R] sqldf: issues with natural joins

2010-05-20 Thread Gabor Grothendieck
They work on any join that is able to make use of them. If you preface the select statement with explain query plan then it will give you some info, e.g. > sqldf('explain query plan select * from main.A natural join main.B') order from detail 1 00 TABLE

Re: [R] Specify correlation structure in lme4

2010-05-20 Thread Ben Bolker
Thomas Stewart gmail.com> writes: > If I have the mixed-model with > > lmer( y ~ x1 + x2 + (1 | id) + (z1 | w ) , ... ) > > there is no way for me to specify a correlation structure for the random > effects? Right? > > If I want to specify correlation structure then I need to use lme in the >

Re: [R] Error in untar2(tarfile, files, list , exdir) : unsupported entry type ‘x’

2010-05-20 Thread Christopher Bare
For posterity, this thread was continued on the R-SIG-Mac mailing list under the same subject. Prof. Brian Ripley was kind enough to point out an easy work around: R CMD INSTALL now uses the internal untar() in package utils: this ensures that all platforms can install bzip2- and xz-compressed tar

Re: [R] sqldf: issues with natural joins

2010-05-20 Thread Nick Switanek
Thank you very much for these clarifying responses, Gabor. I had mistakenly assumed that creating the index on Tid restricted the natural join to joining on Tid. Can you describe when and how indices speed up joins, or can you point me to resources that address this? Is it only for natural joins o

[R] RODBC: sqlSave leave primary key and other columns null

2010-05-20 Thread Douglas . Reich
I have an existing table, and I am trying to use sqlSave to append additional rows to this database. I omit the primary key, which is a uniqueidentifier type (MS SQL), so that the database can populate that field. However, I get the following error: > sqlSave( ch, result, tablename=thetable

[R] crosstabling multiple variables at once

2010-05-20 Thread Biau David
Hi, > >I am trying to describe a data.frame by obtaining multiple crosstable summary >statistics at once. I have tried table, xtab, crosstable, summaryBy and >describe but none of these functions seems to allow muliple conparisons at >once. > Here, is what I would like to do: > >I have, for in

Re: [R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-20 Thread Julian Burgos
Hi Jim I´m using R 2.11.0, on Windows XP. On Thu, May 20, 2010 at 4:55 PM, jim holtman wrote: > Please provide information as to what version you are using; works fine > for me: > > > time3=strptime("2009 06 01 00 47 00",format="%Y %m %d %H %M") > > time4=strptime("2009 06 01 00 57 00",format=

Re: [R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-20 Thread jim holtman
Please provide information as to what version you are using; works fine for me: > time3=strptime("2009 06 01 00 47 00",format="%Y %m %d %H %M") > time4=strptime("2009 06 01 00 57 00",format="%Y %m %d %H %M") > > diff(c(time3,time4)) Time difference of 10 mins > I have version 2.10.1 On Thu, May

[R] Specify correlation structure in lme4

2010-05-20 Thread Thomas Stewart
I know this was asked and answered in 2005, I just want to make sure the answer still holds in 2010. Question: If I have the mixed-model with lmer( y ~ x1 + x2 + (1 | id) + (z1 | w ) , ... ) there is no way for me to specify a correlation structure for the random effects? Right? If I want to s

Re: [R] sqldf: issues with natural joins

2010-05-20 Thread Gabor Grothendieck
Although that works I had meant to write: > names(B)[2] <- "dfNameB" > # ... other commands > sqldf('select * from main.A natural join main.B') so that now only Tid is in common so the natural join just picks it up and also the heuristic works again since we no longer retrieve duplicate column na

[R] Courses***More R courses scheduled for June 2010 by XLSolutions Corp

2010-05-20 Thread Sue Turner
We've scheduled more R courses for June 2010 in Washington DC, San Francisco, Seattle, New York City and other USA cities http://www.xlsolutions-corp.com/Rcourses May - June 2010 *** R/S: Programming Essentials *** R Fundamentals and Programming Techniques *** R/S-PLUS Functions by Example *** R

[R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-20 Thread Julian Burgos
Dear list, I´m calculating time differences between series of time stamps and I noticed something odd: If I do this... > time1=strptime("2009 05 31 22 57 00",format="%Y %m %d %H %M") > time2=strptime("2009 05 31 23 07 00",format="%Y %m %d %H %M") > > diff(c(time1,time2),units="mins") Time differ

Re: [R] Kate terminal window

2010-05-20 Thread Vojtěch Zeisek
Dne Čt 20. května 2010 17:50:42 Luc Villandre napsal(a): > Dear R-users, > > I've recently switched to Ubuntu and I've decided to use Kate to edit my > R code. I really like how Kate allows one to simply pipe their code to > the terminal. However, I would find it even better if I could actually >

Re: [R] Question about difftime()

2010-05-20 Thread Marc Schwartz
On May 20, 2010, at 11:08 AM, Stella Pachidi wrote: > Dear R experts, > > I have a question about the result of difftime() function: Does it > take into account the different number of days in each month. In my > example, I have the following: > >> firstDay > [1] "2010-02-20" >> lastDay > [1] "2

Re: [R] sqldf: issues with natural joins

2010-05-20 Thread Gabor Grothendieck
There are two problems: 1. A natural join will join all columns with the same names in the two tables and that includes not only Tid but also dfName and since there are no rows that have the same Tid and dfName the result has zero rows. 2. the heuristic it uses fails when you retrieve the same co

Re: [R] About the breakpoint when making heatmap with lots of variables

2010-05-20 Thread Shi, Tao
The "breakpoint" you mentioned is irrelevant here. Clustering 15672 genes (I assume this is a microarray data) requires lots of memory. I suggest you either filter your gene list down to thousands or just plot the column dendrogram without showing the heatmap. plot(hclust(dist(x))) ...Tao

Re: [R] writing function

2010-05-20 Thread Ivan Calandra
Hi, the problem is not about the environment, but about the paste(c("tot", i), collapse = "") which is not recognized as an object. Maybe assign() could do the trick You could also do it this way (though it's not exactly what you want, but it might be better): toto <- function(x,y){ tot

Re: [R] finding euclidean proximate points in two datasets

2010-05-20 Thread David Winsemius
On May 20, 2010, at 11:12 AM, Alexander Shenkin wrote: On 5/20/2010 9:18 AM, David Winsemius wrote: On May 20, 2010, at 10:02 AM, Alexander Shenkin wrote: Hello all, I've been pouring through the various spatial packages, but haven't come across the right thing yet. There is a SIG for

Re: [R] p-values < 2.2e-16 not reported

2010-05-20 Thread Will Eagle
On 2010-05-20 08:52, Shi, Tao wrote: Will, I'm wondering if you have any insights after looking at the cor.test source code. It seems to be fine to me, as the p value is either calculated by "your first method" or a .C code. ...Tao Dear Tao, I think the described problem of p-values < 2.

[R] Question about difftime()

2010-05-20 Thread Stella Pachidi
Dear R experts, I have a question about the result of difftime() function: Does it take into account the different number of days in each month. In my example, I have the following: > firstDay [1] "2010-02-20" > lastDay [1] "2010-05-20 16:00:00" > difftime(lastDay,firstDay,units='days') Time diff

Re: [R] [Off topic?] Time dependent Cox model fitting and validation

2010-05-20 Thread Marco Barbàra
this is self-reply only to insert my real name __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] sqldf: issues with natural joins

2010-05-20 Thread Nick Switanek
Hello, I'm having trouble discovering what's going wrong with my use of natural joins via sqldf. Following the instructions under 4i at http://code.google.com/p/sqldf/, which discusses creating indices to speed joins, I have been only unreliably able to get natural joins to work. For example, >

Re: [R] esthetics --- extending the lm command to fixed effects?

2010-05-20 Thread Achim Zeileis
On Thu, 20 May 2010, ivo welch wrote: hi thomas--- thanks for the answer. the problem with the "+factor(fmid)" is not just that it provides uninteresting coefficients and that it eats more memory, but that it is also MUCH slower when there are (hundred of) thousands of fixed effects. There i

Re: [R] writing function

2010-05-20 Thread Tal Galili
Try this: paste("tot", 4:16, sep = "") Or: func <- function(x,y) { paste("tot", x:y, sep = "") } func(4,16) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.b

[R] writing function

2010-05-20 Thread arnaud Gaboury
Dear group, I am trying to write functions, but as a beginner, everything is not so obvious. Let's say I want the results in a list of elemts like this : tot1, tot2, etc Here is a function: toto <- function(x,y) { for(i in x:y){ paste(c("tot",i),collapse="")<-(i*2) } } If I type this : >to

Re: [R] offset in gam and spatial scale of variables

2010-05-20 Thread Joris Meys
On Thu, May 20, 2010 at 3:20 PM, Lucia Rueda wrote: > > Hi, > > Thanks for the inputs. I talked to my coworker, who has been the one doing > the analysis. Perhaps I wasn't making myself clear about the “differences > in > spatial scales”. Here is what he says: > > "The truth is that measuring sc

[R] Kate terminal window

2010-05-20 Thread Luc Villandre
Dear R-users, I've recently switched to Ubuntu and I've decided to use Kate to edit my R code. I really like how Kate allows one to simply pipe their code to the terminal. However, I would find it even better if I could actually get the Kate console to display error messages (or any console ou

Re: [R] RSpython Ubuntu

2010-05-20 Thread kaveh vakili
kaveh vakili ulb.ac.be> writes: > > Dear List, > > I'd like to call pyhton function from within R. I tried installing the latest > version of RSPython: > > wget http://www.omegahat.org/RSPython/RSPython_0.7-1.tar.gz > R CMD INSTALL --clean RSPython_0.7-1.tar.gz > > I get a compile error (po

Re: [R] esthetics --- extending the lm command to fixed effects?

2010-05-20 Thread ivo welch
hi thomas--- thanks for the answer. the problem with the "+factor(fmid)" is not just that it provides uninteresting coefficients and that it eats more memory, but that it is also MUCH slower when there are (hundred of) thousands of fixed effects. Does Bill Venables describe how to do extend the

[R] Comparing three groups, data: present, absent

2010-05-20 Thread Mächler Marc Jacques
Dear R-Experts, Dear friends of dung. I have a statistical Problem, to which nobody I asked could give me an answer. Maybe you can. I was in the African-Savanna and made a Dung-Monitoring. This means I walked randomly over the field and for every Dung-Event I found I noted following parameters

[R] RSpython Ubuntu

2010-05-20 Thread kaveh vakili
Dear List, I'd like to call pyhton function from within R. I tried installing the latest version of RSPython: wget http://www.omegahat.org/RSPython/RSPython_0.7-1.tar.gz R CMD INSTALL --clean RSPython_0.7-1.tar.gz I get a compile error (posted below). Did anyone else run against this ? Is the

Re: [R] esthetics --- extending the lm command to fixed effects?

2010-05-20 Thread Thomas Lumley
On Thu, 20 May 2010, ivo welch wrote: dear R wizards: not important. more a curiosity or esthetics question. is there a way to extend the standard lm command, so that it takes a new argument that handles fixed effects? right now, I have (provided to me from an expert---I would have never fi

[R] Svy function doesn't work nested in user-defined function

2010-05-20 Thread Sabatier, Jennifer F. (CDC/OID/NCHHSTP)
Hi R-help, I posted about this late yesterday but got no response. I may have put TMI in the original request. Not to mention I couldn't cut and paste yesterday because I was working R off a non-network computer while asking for help on a network computer. Essentially, I have this user-define

Re: [R] Using svychisq inside user-defined function

2010-05-20 Thread Thomas Lumley
On Wed, 19 May 2010, Sabatier, Jennifer F. (CDC/OID/NCHHSTP) wrote: Hi R-help, Yes, this is my second request for assistance in a single day I am attempting to use svychisq() inside a function I made. The goal of this function is to produce a table of summary statistics that I can later

Re: [R] factor

2010-05-20 Thread RockO
Try, ofr a factor: > x <-c("A","B","C") > x <- factor(x) > levels(x) [1] "A" "B" "C" > x <- factor(x,levels=levels(x)[c(3,2,1)]) > levels(x) [1] "C" "B" "A" Rock, DRF -- View this message in context: http://r.789695.n4.nabble.com/factor-tp879983p2224639.html Sent from the R help mailing list a

Re: [R] offset in gam and spatial scale of variables

2010-05-20 Thread Lucia Rueda
Hi, Thanks for the inputs. I talked to my coworker, who has been the one doing the analysis. Perhaps I wasn't making myself clear about the “differences in spatial scales”. Here is what he says: "The truth is that measuring scales (i.e all area related variable are measured in m2) and spatial d

[R] RODBC: owerwrite into a named range in Excel

2010-05-20 Thread Jay
Hello, Let's say that I have a data frame of n numbers I want to transfer into a Excel spreadsheet. I have opened the conection to the file using ODBC, and I can query the content of these n cells without problem. However, how do I transfer my new values to these cells? I.e., overwite them. Shoul

  1   2   >