Hi!
I need to perform this simple sampling function several hundred times:
x1=as.character(rnorm(1000, 100, 15))
x2=as.character(rnorm(1000, 150, 10))
y1=as.data.frame(x1,x2)
sample1=as.data.frame(sample(y1$x1, 12, replace = FALSE, prob = NULL))
sample1
write.table(sample1, "sample1.txt", sep="
Thanks, Josh!
The index variable (time) was my problem. My R skills are too low! :)
Problem solved!
--
View this message in context:
http://r.789695.n4.nabble.com/Reshape-from-long-to-wide-format-with-date-variable-tp3648833p3650995.html
Sent from the R help mailing list archive at Nabble.com.
Hi,
I need to reshape my dataframe from a long format to a wide format.
Unfortunately, I have a continuous date variable which gives me headaches.
Consider the following example:
> id=c("034","034","016","016","016","340","340")
> date=as.Date(c("1997-09-28", "1997-10-06", "1997-11-04", "2000-09-
Gabor Grothendieck wrote:
>
> On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete <noxyp...@gmail.com>
> wrote:
>>
>> Hi,
>> consider the following two dataframes:
>> x1=c("232","3454","3455","342","13")
>>
Hi,
consider the following two dataframes:
x1=c("232","3454","3455","342","13")
x2=c("1","1","1","0","0")
data1=data.frame(x1,x2)
y1=c("232","232","3454","3454","3455","342","13","13","13","13")
y2=c("E1","F3","F5","E1","E2","H4","F8","G3","E1","H2")
data2=data.frame(y1,y2)
I need a new column i
5 matches
Mail list logo