Re: [R] Convert json data to an r dataframe

2012-12-28 Thread sp.duccio
Thank you very much, Rui! The problem with your script is that data is now in a string format, while I need to obtain a data.frame instead. Do you really think that I cannot do anything else with this json data? Thank you very much again Duccio 2012/12/27 Rui Barradas ruipbarra...@sapo.pt

Re: [R] Conjunction and disjunction in pubmed query

2012-12-28 Thread David Winsemius
On Dec 27, 2012, at 3:10 PM, email wrote: Hi: I am trying to query pubmed abstracts using the following syntax: url= http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?; search = paste(url, db=pubmedterm=, queryTerm1, +AND+, queryTerm2,+OR+,queryTerm3, +OR+, queryTerm4,

Re: [R] Convert json data to an r dataframe

2012-12-28 Thread Jeff Newmiller
It really seems to me that what you ought to be doing is carefully studying the code provided at the lamages link that you referenced until you can modify it to do what you want. It really isn't fair for you to ask people to do your thinking for you. This is the R-help mailing list, not

Re: [R] Convert json data to an r dataframe

2012-12-28 Thread sp.duccio
Sorry, I really didn't want to push anyone to make my work. Sorry if my words sounded like that. I appreciated your help very much. Thank you D. 2012/12/28 Jeff Newmiller jdnew...@dcn.davis.ca.us It really seems to me that what you ought to be doing is carefully studying the code provided at

Re: [R] R crashing inconsistently within for loops

2012-12-28 Thread Jeff Newmiller
You are not wrong to expect R to not crash. However, R (as most people use it) is not monolithic, and you have provided neither reproducible code nor sessionInfo() with the relevant packages loaded to help anyone interested in investigating the problem. You are the most likely person to be able

Re: [R] R crashing inconsistently within for loops

2012-12-28 Thread Prof Brian Ripley
Note though that the posting guide asked you not to use the word 'crash', as your audience has no idea what you mean by it. In some of the senses people use (e.g. when R reports an error in your code), you should expect R to 'crash'. On 28/12/2012 09:04, Jeff Newmiller wrote: You are not

[R] Merging data tables

2012-12-28 Thread Neotropical bat risk assessments
Hi all, I am trying to merge several data sets and end up with a long data format by date time so I can run correlations and plots. I am using Deducer as an R GUI but can just use the R console if easier. The data sets are weather with wind speed, relative humidity and temperatures by date

Re: [R] Dock graphs when using R in Eclipse with StatET plug In

2012-12-28 Thread Tobias Kisch
Anyone have a solution to this by now? Unfortunately, I made some changes, and now the graphic window pops up and can’t be docked anymore. Thanks for any hints! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Merging data tables

2012-12-28 Thread Djordje Bajic
see ?merge, for your dataframes, the following should work: merge(bat_activity, weather, by=c(date, time), all=T) 2012/12/28 Neotropical bat risk assessments neotropical.b...@gmail.com Hi all, I am trying to merge several data sets and end up with a long data format by date time so I can

[R] Irreproducible exception in R extension

2012-12-28 Thread Simon Zehnder
Dear R-Users, I am having some trouble running an R extension on our cluster (linux). I call C++ code in which I use a) the Scythe Statistical Library and b) OpenMP. Most of the jobs run without a problem, but some arbitrary jobs throw an exception of the kind printed below while running in a

[R] Irreproducible exception in R extension

2012-12-28 Thread Simon Zehnder
Dear R-Users, I am having some trouble running an R extension on our cluster (linux). I call C++ code in which I use a) the Scythe Statistical Library and b) OpenMP. Most of the jobs run without a problem, but some arbitrary jobs throw an exception of the kind printed below while running in a

Re: [R] help with reshaping wide to long format

2012-12-28 Thread arun
Hi, DId you tried copy and paste the code in my reply?  If not, please do.  In your previous replies, you forgot to close the  bracket()) or adding # in between the codes.  Please check your codes. It would be also helpful to read the posting guide

Re: [R] Merging data tables

2012-12-28 Thread arun
HI, YOu may try ?merge() or ?join() from library(plyr) bat_activity-read.table(text= Date Time Label Number 6/3/2011 10:01 Tadbra 2 6/3/2011 10:02 Tadbra 4 6/3/2011 10:08 Tadbra 1 6/3/2011 10:13 Tadbra 2 6/3/2011 10:49 Tadbra

Re: [R] efficiently multiply different matrices in 3-d array with different vectors?

2012-12-28 Thread Ranjan Maitra
On Thu, 27 Dec 2012 22:03:19 -0800 arun smartpink...@yahoo.com wrote: HI, Not sure if this is what you wanted: set.seed(14) Z-array(sample(1:100,80,replace=TRUE),dim=c(5,2,8)) set.seed(21) Y-matrix(sample(1:40,40,replace=TRUE),nrow=8) do.call(cbind,lapply(seq_len(dim(Z)[1]),function(i)

Re: [R] Merging data tables

2012-12-28 Thread arun
HI, It is related to the memory. Check these links for discussions regarding this matter: http://r.789695.n4.nabble.com/Memory-Problem-td853869.html http://r.789695.n4.nabble.com/Memory-issues-td3220252.html A.K. From: Neotropical bat risk assessments

[R] Question about Linear Regression

2012-12-28 Thread Lorenzo Isella
Dear All, A semi-trivial question: suppose you want to carry out a linear regression of the kind y~x1+x2+x3 where x3 is a dichotomous variable assuming only 0 and 1 values (x1 and x2 are continuous variables). Is there any particular caveat I should be aware of? Can I code this as a

Re: [R] Question about Linear Regression

2012-12-28 Thread Jeremy Miles
You can run that as it is. The term to search for on Google is 'dummy coding'. Jeremy On 28 December 2012 07:45, Lorenzo Isella lorenzo.ise...@gmail.com wrote: where x3 is a dichotomous variable assuming only 0 and 1 values (x1 and x2 are continuous variables). Is there any particular

Re: [R] Help reading matrixmarket files

2012-12-28 Thread Brad Cox
Could someone please approve this message? Thanks! On Thu, Dec 27, 2012 at 4:38 PM, Brad Cox bradj...@gmail.com wrote: I'm trying to read data a program produces in matrixmarket array format into R and its giving me fits. I've tried read.MM (below) and readMM (from the Matrix package) but

Re: [R] vectorization modifying globals in functions

2012-12-28 Thread Greg Snow
In current versions of R the apply functions do not gain much (if any) in speed over a well written for loop (the for loops are much more efficient than they used to be). Using global variables could actually slow things down a little for what you are doing, if you use `-` then it has to search

Re: [R] Help reading matrixmarket files

2012-12-28 Thread Uwe Ligges
On 28.12.2012 17:28, Brad Cox wrote: Could someone please approve this message? Thanks! Approve? On Thu, Dec 27, 2012 at 4:38 PM, Brad Cox bradj...@gmail.com wrote: I'm trying to read data a program produces in matrixmarket array format into R and its giving me fits. I've tried read.MM

Re: [R] R crashing inconsistently within for loops

2012-12-28 Thread William Dunlap
Sometimes these intermittent crashes come from memory misuse, e.g., not allocating enough scratch space. You can sometimes make those coding errors cause more consistent problems by calling gctorture(TRUE) before running your code. Here is an example in which it looks like package:gam's lo()

[R] Using grImport to create a watermark

2012-12-28 Thread Thomas Adams - NOAA Federal
Hi… I want to use grImport to create a watermark on a plot() using the methods Paul Murrell describes here: http://cran.r-project.org/web/packages/grImport/vignettes/import.pdf (page 28). I can essentially reproduce this manually at the R prompt, and independently I can use grid.picture(…)

[R] multiple sheet in r

2012-12-28 Thread eliza botto
Dear useRs, i want to open an excel file having 59 sheets in r and GOD knows the number of command i tried. unfortunately none worked, obviously error will be on my part. All the sheets contain 1 kind of data and the data starts from A12:M12 (which contains the header of the data), the line

[R] Any simple way to make this happen?

2012-12-28 Thread Haoda Fu
Hi, The data is x - c(4,3,5); I need to translate it to y - c(1,2,3,4,1,2,3,1,2,3,4,5); i.e. for each number in x, we need to generate 1:x and put it in y. The program need to evaluate this type of calculation for millions of times in simulation. Is there any elegant way to make this happen

Re: [R] Any simple way to make this happen?

2012-12-28 Thread William Dunlap
x - c(4,3,5) y - c(1,2,3,4,1,2,3,1,2,3,4,5) all.equal(y, sequence(x)) [1] TRUE 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 Haoda Fu Sent: Friday, December

Re: [R] multiple sheet in r

2012-12-28 Thread Greg Snow
If you want help from us mere mortals then it would help us to help you if you could tell us not only the number of commands that you tried but what the actual commands were. Also the phrase none worked does not help us help you, see fortune(324). A description of what happened and how the

Re: [R] Any simple way to make this happen?

2012-12-28 Thread Haoda Fu
It works like a magic~!! Many thanks A.K. Best, Haoda From: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Friday, December 28, 2012 12:51 PM Subject: Re: [R] Any simple way to make this happen? Hi, Try:

Re: [R] Any simple way to make this happen?

2012-12-28 Thread Greg Snow
The only way that I can think of that would not use iteration would be to create some type of lookup table with every possible vector you may ever use, then lookup the results in that table. If you are happy with internal iteration then one possibility is: x - c(4,3,5)

Re: [R] vectorization modifying globals in functions

2012-12-28 Thread David Winsemius
On Dec 27, 2012, at 12:38 PM, Sam Steingold wrote: I have the following code: --8---cut here---start-8--- d - rep(10,10) for (i in 1:100) { a - sample.int(length(d), size = 2) if (d[a[1]] = 1) { d[a[1]] - d[a[1]] - 1 d[a[2]] - d[a[2]] + 1 } }

Re: [R] multiple sheet in r

2012-12-28 Thread eliza botto
Dear Arun and Greg,extremly sorry for asking you into something which was quite easy...the following command worked library(XLConnect)sheets - list()for(x in 1:59) {sheets[[x]] - readWorksheetFromFile(PAK.xls, sheet=x[i],region=A12:M1)} regardselisa Date: Fri, 28 Dec 2012 10:56:43 -0700

Re: [R] Help reading matrixmarket files

2012-12-28 Thread Brad Cox
On Fri, Dec 28, 2012 at 11:47 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Approve? Isn't it still being queued for approval? Can't tell from this end. Your mail to 'R-help' with the subject Help reading matrixmarket files Is being held until the list moderator can review it

Re: [R] Help reading matrixmarket files

2012-12-28 Thread Uwe Ligges
On 28.12.2012 19:49, Brad Cox wrote: On Fri, Dec 28, 2012 at 11:47 AM, Uwe Ligges lig...@statistik.tu-dortmund.de mailto:lig...@statistik.tu-dortmund.de wrote: Approve? Isn't it still being queued for approval? Can't tell from this end. Your mail to 'R-help' with the subject Help

Re: [R] Using grImport to create a watermark

2012-12-28 Thread Prof Brian Ripley
I suspect you need a device supporting translucency: PostScript does not and hence postscript() cannot. Try the pdf() device (and convert the output if you need it). On 28/12/2012 17:23, Thomas Adams - NOAA Federal wrote: Hi… I want to use grImport to create a watermark on a plot() using

Re: [R] multiple sheet in r

2012-12-28 Thread arun
HI, Check this link: http://stackoverflow.com/questions/6894922/how-to-read-multiple-excel-sheets-in-r-programming http://theweiluo.wordpress.com/2011/09/07/how-to-read-a-multiple-sheet-excel-file-into-r/ A.K. - Original Message - From: eliza botto eliza_bo...@hotmail.com To:

Re: [R] comparison of large data set

2012-12-28 Thread Irucka Embry
Hi Jean, thank-you. It was my fault on not ccing R-help on the previous correspondence. With regards to the FALSE/TRUE or 0/1, you are right that they are the same logical identities, but it better suits our original numerical data to display 0s and 1s. I want to thank you for correcting the 2

Re: [R] Any simple way to make this happen?

2012-12-28 Thread arun
Hi, Try: y-paste(c,(,paste(unlist(sapply(x,seq)),collapse=,),),sep=)  y #[1] c(1,2,3,4,1,2,3,1,2,3,4,5) A.K. - Original Message - From: Haoda Fu fu...@yahoo.com.cn To: r-help@r-project.org r-help@r-project.org Cc: haod...@yahoo.com haod...@yahoo.com Sent: Friday, December 28, 2012

Re: [R] Merging data tables

2012-12-28 Thread Ian Fellows
It is also possible to construct the r call in the GUI. See: http://www.deducer.org/pmwiki/index.php?n=Main.MergeData Ian Sent from my iPhone On Dec 28, 2012, at 4:41 AM, Djordje Bajic je.li@gmail.com wrote: see ?merge, for your dataframes, the following should work:

Re: [R] Using grImport to create a watermark

2012-12-28 Thread Thomas Adams - NOAA Federal
Prof Ripley, I see that now; I can get the transparency to work, but even with using pdf() my plot still does not draw if I first use: grid.picture(noaalogo,distort=**FALSE,width=0.5,x=0.50,y=0.50) grid.rect(gp=gpar(fill=rgb(1,**1,1,0.9))) Regards, Tom On Fri, Dec 28, 2012 at 1:55 PM, Prof

Re: [R] comparison of large data set

2012-12-28 Thread Adams, Jean
Irucka, You could assign names to the compare.all list ... for example ... names(compare.all) - paste0(Obs, 1:54) Then, when you create the subset list, justbig, it will have the appropriate names. If you just want to see the indices of the successful locations, you could print

[R] parallel error message extraction (in mclapply)?

2012-12-28 Thread ivo welch
dear R experts---I am looking at a fairly uninformative error in my program: Error in mclapply(1:nrow(opts), solveme) : (converted from warning) all scheduled cores encountered errors in user code the doc on ?mclapply tells me that In addition, each process is running the job inside

Re: [R] R crashing inconsistently within for loops

2012-12-28 Thread Ben Bolker
Steve Powers powers_s at nd.edu writes: Hello, This one has been bugging me for a long time and I have never found a solution. I am using R version 2.15.1 but it has come up in older versions of R I have used over the past 2-3 years. Q: Am I wrong to expect that R should handle

[R] Problem to load a shape file

2012-12-28 Thread dms
Dear all, I've been puzzled why I not able to load a shapefile from a connection. Does anyone here can give a reasonable answer? When I try the following script I got this error: Error in getinfo.shape(fn) : Error opening SHP file #Reproduction temp - tempfile()