Re: [R-es] Separate

2015-03-04 Thread Carlos J. Gil Bellosta
¿En serio te obligan a usar una versión de R de hace cinco años? La gente de esta lista es muy amable y ha tratado de echarte un cable. Si esa pregunta la llevas a otros foros (p.e., la lista R-help) te habrías llevado algún gorrazo (virtual). Supongo que no usas R 2.11 por iniciativa o voluntad

Re: [R] sampling dataframe based upon number of record occurrences

2015-03-04 Thread David L Carlson
I'm not sure I understand, but I think you have a large data frame with records and you want to construct a sample of that data frame that includes no more than 3 records for each IDbyYear combination? You say there are 5589 unique combinations and your code uses a data frame called

[R] remove repeated string in list

2015-03-04 Thread Karim Mezhoud
Dear All, here an example temp - list(set1=c(a,b,d,x), set2=c(b,c,q,m), set3=c(b,f,e,k,q,h)) preserve only the first one string temp set1 a b d x set2 c q m set3 f e k h OR remove repeated string temp set1 a d x set2 c m set3 f e k h Thanks [[alternative HTML version deleted]]

[R-es] pregunta

2015-03-04 Thread jbetancourt
con el paquete xtable_1.7-4.z no me construye las tablas sino que da las salidas en xml, adjunto documento con los scrips y las salidas uso el R 3.1.1 sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Spanish_Spain.1252

[R-es] pregunta

2015-03-04 Thread jbetancourt
con el paquete xtable_1.7-4.z no me construye las tablas sino que da las salidas en xml, adjunto documento con los scrips y las salidas uso el R 3.1.1 sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Spanish_Spain.1252

Re: [R-es] Separate

2015-03-04 Thread pepeceb
Carlos, totalmente de acuerdo en que la gente de esta lista es muy amable...y en lo demás tambien.Lo que me obligan a usar son unas librerías que dejaron de actualizarse en el 2009 (COSTcore) y la versión más moderna que soportan es la R 2.1. Nos vienen estupendo para unos análisis concretos,

[R] Using dates in R

2015-03-04 Thread Brian Hamel
Hi all, I have a dataset that includes a date variable. Each observation includes a date in the form of 2/15/15, for example. I'm looking to create a new indicator variable that is based on the date variable. So, for example, if the date is earlier than today, I would need a 0 in the new column,

Re: [R] sampling dataframe based upon number of record occurrences

2015-03-04 Thread JS Huang
Here is an implementation with function named getSample. Some modification to the data was made so that it can be read as a table. fitting.set IDbyYear SiteID Year 1 42.24 A-Airport 2006 2 42.24 A-Airport 2006 3 42.24 A-Airport 2006 4

Re: [R] sampling dataframe based upon number of record occurrences

2015-03-04 Thread Curtis Burkhalter
That worked great, thanks so much David! On Wed, Mar 4, 2015 at 8:23 AM, David L Carlson dcarl...@tamu.edu wrote: I'm not sure I understand, but I think you have a large data frame with records and you want to construct a sample of that data frame that includes no more than 3 records for each

Re: [R-es] pregunta

2015-03-04 Thread Javier Marcuzzi
Estimado José betancourt En este momento no puedo probar el código que usted envía, pero hay dos preguntas que son básicas, pero puede ser que por distracción el error esté en lo siguiente. 1) El código que envía está en Rnw o R. 2) Está latex instalado. Entiendo que todo esto estaría correcto,

[R] summary.formula()

2015-03-04 Thread Hua Liang
I try to use t.test instead of Wilcox.test in summary.formula() , a very decent function developed by Frank, as follows. But I got error messages. Can someone help me out? Dick uT-function(a,b){ j-t.test(a) p-list(P=j$p.value,stat=j$statistic,

Re: [R] Using dates in R

2015-03-04 Thread David L Carlson
Wow! A bold prediction from someone who has done exactly zero investigation of the basic, built-in date/time features in R. Since your example did not include the first two digits of the year, I've used %y instead of %Y. That will assume 19 precedes values from 69-99 and 20 precedes values from

[R] FW: FW: confidence intervals values in locpol

2015-03-04 Thread IOANNA IOANNOU
Hello all, A straightforward question. How can I get a the values of the 90% confidence intervals of a locpol in R? I can see how you can plot the mean as well as the confidence intervals. I would like the matrix of the values corresponding to the 95% and 5% exceedance probability.

Re: [R] Using dates in R

2015-03-04 Thread MacQueen, Don
Your hunch is wrong. Start by typing ?Date at the R prompt. Continue with ?as.Date Then to find out if the date is earlier than today delta - thedate - Sys.Date() (of course, that will change if you use it tomorrow) Getting your indicator variable can be done very easily with base R; no

Re: [R-es] pregunta

2015-03-04 Thread Freddy Omar López Quintero
​Hola JBetancourt:​ con el paquete xtable_1.7-4.z no me construye las tablas sino que da las salidas en xml, adjunto documento con los scrips y las salidas uso el R 3.1.1 ¿​Exactamente qué es lo que quiere hacer?​ Hasta donde sé, la librería xtable devuelve tablas en formato LaTeX o html.

Re: [R] Suggestion in justify in write.fwf {gdata}

2015-03-04 Thread Federman, Douglas
Perhaps you should contact the package maintainer regarding this request. Who is wise? One who learns from every person. Who is strong? One who overpowers his evil inclinations. Who is rich? One who is satisfied with his lot. Who is honorable? One who honors his fellows. - Pirkei Avot [excerpt]

[R] Fitting Legend to Matrix Plot

2015-03-04 Thread Rich Shepard
I have a matrix plot of ternary diagrams (pdf attached) generated with these commands: opar - par(xpd=NA,no.readonly=T) plot(WintersY, pch=as.numeric(WintersX4), col=c(black,red,green,blue,yellow,orange)[WintersX4]) legend(x=0.75, y=0.0, abbreviate(levels(WintersX4),

[R] Suggestion in justify in write.fwf {gdata}

2015-03-04 Thread Leandro Marino
Hi, Sometimes, I need to do some hard work when exporting files using gdata package. It will be very useful if the justify parameter of write.fwf can receive vectors. In some jobs I need to left and right justify in different columns of the same file. Nowadays, I do a lot ow this working in

[R] Second order bessel function

2015-03-04 Thread Chris Vanlangenberg
Hi all, I want to compute the numerical values for modified second order bessel function given x and other parameters, currently base R has a bessel function for 1st order and I have tried to use the relationship between 1st and 2nd order to compute the 2nd order bessel function, but I ended up

Re: [R] Mining non-english text

2015-03-04 Thread Loris Bennett
saikiran putta putta.saikiran1...@gmail.com writes: I am new to R programming and trying to mine this pdf file http://164.100.180.82/Rollpdf/AC276/S24A276P001.pdf. This pdf file is in non-English language and I'm not able to figure out how to proceed. And, I'm not even sure how to extract

Re: [R] sampling dataframe based upon number of record occurrences

2015-03-04 Thread JS Huang
Since you indicated there are six more columns in the data.frame, getSample modified below to take care of it. getSample function(x) { sites - unique(x$SiteID) years - unique(x$Year) result - data.frame() x$ID - seq(1,nrow(x)) for (i in 1:length(sites)) { for (j in

Re: [R] Using dates in R

2015-03-04 Thread William Dunlap
You will need to convert strings like 2/15/15 into one of the time/date classes available in R and then it is easy to do comparisons. E.g., if you have no interest in the time of day you can use the Date class: d - as.Date(c(12/2/79, 4/15/15), format=%m/%d/%y) today - as.Date(2015-03-04) #

Re: [R] Using dates in R

2015-03-04 Thread Peter Alspach
Tena koe Brian See ?as.Date and ?strptime (and, maybe, ?locales). For example: as.Date('2/15/15', '%m/%d/%y') [1] 2015-02-15 as.Date('12/15/14', '%m/%d/%y') as.Date('2/15/15', '%m/%d/%y') [1] TRUE as.Date('12/15/16', '%m/%d/%y') as.Date('2/15/15', '%m/%d/%y') [1] FALSE You might have

[R] format( www.R-project.org , year = 2015)

2015-03-04 Thread Martin Maechler
The R Foundation is pleased to announce that our website http://www.r-project.org/ has under gone a nice retouch (and thus arrived in the 21st century :-) Thanks to a working group of Dirk Eddelbuettel, Simon Urbanek and Hadley Wickham., the current page sources are in markdown, and the html

[R] Online R server with instant messaging access

2015-03-04 Thread Enric Cervera Mateu
Dear all, I have set up a dedicated R server, which can be used by anyone with an instant messaging application (Telegram). See instructions at: http://telemath.altervista.org/TeleR.html It's still experimental, and not heavily tested. Any feedback or comment is absolutely welcome. Hope you

Re: [R] Using dates in R

2015-03-04 Thread Myfanwy Johnston
Our R-user's group (UC Davis) has a good post on working with dates/times in R: http://www.noamross.net/blog/2014/2/10/using-times-and-dates-in-r---presentation-code.html On Wed, Mar 4, 2015 at 11:08 AM, David L Carlson dcarl...@tamu.edu wrote: Wow! A bold prediction from someone who has done

Re: [R] Using dates in R

2015-03-04 Thread Steve Taylor
today - as.Date(2015-03-04) # default format Better is: today - Sys.Date() S -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap Sent: Thursday, 5 March 2015 7:47a To: Brian Hamel Cc: r-help@r-project.org Subject: Re: [R] Using dates in R

Re: [R] help with RODBC

2015-03-04 Thread Jeff Newmiller
Why do you have single quotes inside your single quotes? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

[R] R 3.1.2 using a custom function in aggregate() function on Windows 7 OS 64bit

2015-03-04 Thread Typhenn Brichieri-Colombi via R-help
Hello, I am trying to use the following custom function in an aggregatefunction, but cannot get R to recognize my data. I’ve read the help on function()and on aggregate() but am unable to solve my problem. How can I get R torecognize the data inputs for the custom function nested within

[R] .SavedPlots and replayPlot

2015-03-04 Thread Jean-Luc Dupouey
I would like to redraw a plot from the .SavedPlots object (list), using R code (not arrows on the keyboard). windows(record=TRUE) x=runif(100) plot(x,col=blue) hist(x,col=red) plot(x,col=green) #When I try to replay any of the recorded plots (here, the second one), I get the following

[R] help with RODBC

2015-03-04 Thread Alemu Tadesse
I want to apply the following query to my database. P2-sqlQuery(ch1,'select *, TimeStamp_Local, ref_density, ref_dewpoint, ref_dir, ref_precip, ref_press, ref_rh, ref_snowfall, ref_snowdepth, ref_temperature_avg,

Re: [R] remove repeated string in list

2015-03-04 Thread JS Huang
Hi, Here is one for preserving the first strings. as.numeric in the previous posting is not necessary. temp $set1 [1] a b d x $set2 [1] b c q m $set3 [1] b f e k q h sapply(1:length(temp),function(x){c - list(); for (j in 1:x){c - c(c,temp[[j]])};

Re: [R] remove repeated string in list

2015-03-04 Thread JS Huang
Hi, To avoid hardcoded 1:3, here is some revision. temp $set1 [1] a b d x $set2 [1] b c q m $set3 [1] b f e k q h sapply(1:*length(temp)*,function(x){temp[[x]][as.numeric(table(unlist(temp))[temp[[x]]])==1]}) [[1]] [1] a d x [[2]] [1] c m [[3]] [1] f e k h -- View this message in

Re: [R] R 3.1.2 using a custom function in aggregate() function on Windows 7 OS 64bit

2015-03-04 Thread Bert Gunter
What do you think dat$a is? I recommend that you spend some time with an R tutorial if you plan to use R. Your code is pretty bad. Examples: use of the ifelse construction instead of if ... else; return() Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not

Re: [R] remove repeated string in list

2015-03-04 Thread JS Huang
Hi, Here is one for removing repeated strings. temp $set1 [1] a b d x $set2 [1] b c q m $set3 [1] b f e k q h sapply(1:3,function(x){temp[[x]][as.numeric(table(unlist(temp))[temp[[x]]])==1]}) [[1]] [1] a d x [[2]] [1] c m [[3]] [1] f e k h -- View this message in context:

Re: [R] remove repeated string in list

2015-03-04 Thread Karim Mezhoud
Many Thanks JS karim On Thu, Mar 5, 2015 at 4:08 AM, JS Huang js.hu...@protective.com wrote: Hi, Here is one for preserving the first strings. as.numeric in the previous posting is not necessary. temp $set1 [1] a b d x $set2 [1] b c q m $set3 [1] b f e k q h

[R] FW: Frontier efficient using black litterman model In R

2015-03-04 Thread Ava Yang
Hi Mukesh, Glad to see someone using BLCOP. You didn't provide a reproducible example so I assume you got a result list complete from optimalPortfolios.fPort() and wanted to obtain details of all the 10 simulations. Short answer to your question: the function only renders the optimal value

Re: [R-es] [Grupo de Usuarios de R de Madrid]: Hoy reunión (3-Marzo)...

2015-03-04 Thread Carlos Ortega
Buenas a todos, Ya está disponible el material: videos, presentaciones y código de la reunión de ayer: http://madrid.r-es.org/jueves-5-de-marzo-2015/ Gracias, Carlos. El 3 de marzo de 2015, 13:16, Carlos Ortega c...@qualityexcellence.es escribió: Hola, Aunque lo hemos anunciado en Meetup

Re: [R-es] [Grupo de Usuarios de R de Madrid]: Hoy reunión (3-Marzo)...

2015-03-04 Thread miguel.angel.rodriguez.muinos
Hola Carlos. Enhorabuena por la gran actividad en vuestro grupo y gracias por compartirlo con nosotros (y por la celeridad en hacerlo). Un Saludo, Miguel. El 04/03/2015 a las 11:24, Carlos Ortega escribió: Buenas a todos, Ya está disponible el material: videos, presentaciones y código de

[R-es] Separate

2015-03-04 Thread pepeceb
Hola a tod@sAlguien conoce alguna función similar a separate del paquete tidyr ? Quiero hacer algo similar a : separate(storms, date,c(y,m,d)) Es decir, separar la fecha en tres columnas (año, mes y día) Lo malo es que no puedo usar separate porque tengo que usar un R 2.11 o anterior y el

Re: [R-es] Separate

2015-03-04 Thread Carlos Ortega
Hola, Puedes hacerlo así: #- dat - data.frame( fechas = c( 1/1/2001, 1/2/2002, 1/3/2003) ) tmp - as.data.frame( str_split_fixed( dat$fechas, /, n = 3 ) ) head(tmp) V1 V2 V3 1 1 1 2001 2 1 2 2002 3 1 3 2003 #--- Eso sí, te exige tener cargado el

Re: [R-es] Separate

2015-03-04 Thread miguel.angel.rodriguez.muinos
Puedes echarle un ojo a la función split() creo que te puede servir (en función del formato en el que tengas recogidas esas fechas) Un saludo, Miguel. El 04/03/2015 a las 13:21, pepeceb escribió: Hola a tod@sAlguien conoce alguna función similar a separate del paquete tidyr ? Quiero hacer