[R-sig-eco] Help with a function

Rodrigues rodriguesmsb at gmail.com
Fri Jun 6 15:39:54 CEST 2014


Dear R users,


I’m trying to build a function to select random samples idf’s from a
database.
So, my data frame had 2 columns and 575 rows. Follow bellow an example of my
database
Idf1	casod
12	1
14	1
15	1
16	1
17	3
18	3
19	3
21	3
25	1
24	1
26	1
28	1
29	3
32	3
33	3
35	1
36	3
37	1
48	3

So my function is

blinding=function(sample){
  sort=sample(idf1,10,replace=F) 
  return(sort2)
}

It is pretty simple and I would like to add one more step in my choice. I
would like to link my choice to casod stats. Thus if casod==3 sample would
be random idfs could not be an idf with casod=1. Does someone can help me?




--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Help-with-a-function-tp7578931.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



More information about the R-sig-ecology mailing list