¿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
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
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]]
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
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
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,
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,
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
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
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,
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,
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
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.
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
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.
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]
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),
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
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
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
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
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) #
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
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
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
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
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
Why do you have single quotes inside your single quotes?
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...
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
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
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,
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]])};
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
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
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:
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
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
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
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
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
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
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
42 matches
Mail list logo