a(x1)]<-NA;x})
> data2
> # x1 x2 x3 x4
> #1 0.482 1.320 -0.859 -0.142
> #2 -0.753 -0.041 NA NA
> #3 0.028 -0.256 -0.069 0.354
> #4 -0.086 0.475 0.244 0.781
> #5 0.690 -0.181 1.274 1.633
> A.K.
>
>
>
> ----- Original Me
86 0.475 0.244 0.781
> #5 0.690 -0.181 1.274 1.633
> A.K.
>
>
>
> - Original Message -
> From: Christopher Desjardins
> To: "r-help@r-project.org"
> Cc:
> Sent: Friday, August 16, 2013 3:02 PM
> Subject: [R] Randomly drop a percent of data from a d
NA
#3 -1.09734838 0.2069539 -0.6997853
#4 0.75919499 -0.5683809 0.4752002
#5 -0.03063141 -0.7549605 2.6038635
A.K.
From: Richard Kwock
To: arun
Cc: Christopher Desjardins ; R help
Sent: Friday, August 16, 2013 5:55 PM
Subject: Re: [R] Randomly drop a
.633
A.K.
- Original Message -
From: Christopher Desjardins
To: "r-help@r-project.org"
Cc:
Sent: Friday, August 16, 2013 3:02 PM
Subject: [R] Randomly drop a percent of data from a data.frame
Hi,
I have the following data.
> set.seed(6245)
> data <- data.frame(
Hi,
I have the following data.
> set.seed(6245)
> data <- data.frame(x1=rnorm(5),x2=rnorm(5),x3=rnorm(5),x4=rnorm(5))
> round(data,digits=3)
x1 x2 x3 x4
1 0.482 1.320 -0.859 -0.142
2 -0.753 -0.041 -0.063 0.886
3 0.028 -0.256 -0.069 0.354
4 -0.086 0.475 0.244 0.781
5 0.69
5 matches
Mail list logo