[R] A re-sampling problem

Nathan Cooper nathanwands at hotmail.com
Sat Sep 27 04:28:09 CEST 2003


I plan on analyzing some bird point count data. I need to develop a 
re-sampling regime for data like this.

I used scan(file="Sample.txt",what=list(0,0,0,0,0,0),sep="\t")

[[1]]
[1] 1 2 3 4 5

[[2]]
[1]  6  7  8  9 NA

[[3]]
[1] 10 11 12 13 NA

[[4]]
[1] 14 15 16 NA NA

[[5]]
[1] 17 18 19 20 21

Each row represents one site and the numbers (1-21) are visits to that site. 
I'm going to be figuring out how many visits to each site is optimal so I 
will need to compare 1 visit to 2 visits to 3 visits etc. Therefore I need 
to somehow sample 1,2,3,4,or 5 visits with replacement from a random (with 
replacement) row 1000 times. Any ideas? I'm relatively familiar with the 
sample() functoin but not sure how to make it do this. I'm open to importing 
the data in a different way if that would make it easier. Thanks,

Nathan

_________________________________________________________________
Share your photos without swamping your Inbox.  Get Hotmail Extra Storage 
today! http://join.msn.com/?PAGE=features/es




More information about the R-help mailing list