randomize_vector | R Documentation |
Use function 'sample' from base R library to generate a random sample. Function taken from Edzer Pebesma package.
randomize_vector(X, N)
X |
vector to choose from |
N |
number of random elements to select from X |
a list, a vector
library(spdep)
example(columbus)
#col_nbq <- poly2nb(columbus)
#a.lw <- nb2listw(col_nbq, style="W")
#set.seed(123)
DF <- data.frame(1:length(columbus$CRIME),columbus$CRIME,columbus$INC)
X1<-randomize_vector(DF$Obs,999)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.