Displaying 2 results from an estimated 2 matches for "ganganap".
Did you mean:
gangan
2012 Nov 21
1
FW: Select a random subset of rows out of matrix
Hi,
This is Madhu and I have a following doubt please give a solution...
**>i have the following data frame
from this i want to select a 80% of data randomly in such a way that
if the selected records are 1 and then we have to get the all records corresponding to 1
similarly for 2 also and soon......... help me
data<-data.frame(x=c(1,1,2,2,2,3,4,4,4),y=c(23,45,87,46,78,12,87,79));**
2012 Nov 22
0
selcting a random sample and saving it in a seprate dataframe and also remaining part in other data frame
...ou can have a list containing both the dataframes
list1<-list(dat1[dat1$x%in%s,],dat1[!dat1$x%in%s,])
list1
[[1]]
#? x? y
#3 2 87
#4 2 46
#5 2 78
#6 3 12
#7 4 87
#8 4 79
#9 4 76
#[[2]]
?# x? y
#1 1 23
#2 1 45
is.data.frame(list1[[1]])
#[1] TRUE
A.K.
----- Original Message -----
From: Madhu Ganganapalli <mganganapalli at upstreamsoftware.com>
To: arun <smartpink111 at yahoo.com>
Cc:
Sent: Thursday, November 22, 2012 2:53 AM
Subject: selcting a random sample and saving it in a seprate dataframe and also remaining part in other data frame
**>
My question is:
I have the followin...