search for: streamland23

Displaying 1 result from an estimated 1 matches for "streamland23".

2012 Oct 24
1
randomly select another observation with same grouping factor and year value, do for every record in dataframe
...ist of the RchID of the first observation, the RchID of the second randomly chosen observation, and several other characteristics of the randomly chosen observation. Below is the code I have written, but it doesn't work. Thanks for any help. Christy ################test roads=read.csv("streamland23.csv") for (i in 1:nrow (roads)){ Sitetype= roads$Sitetype yr=roads$REACH_Yr initRchid=roads$RchID huc1=roads$HUC sample.df <- function(df, n) df[sample(nrow(df), n), , drop = FALSE] selected=sample.df(roads[roads$HUC == "huc1"& roads$REACH_Yr =="yr" , ], 1) outp...