randomize_vector {bispdep}R Documentation

Generate a random sample from other vector

Description

Use function 'sample' from base R library to generate a random sample. Function taken from Edzer Pebesma package.

Usage

randomize_vector(X, N)

Arguments

X

vector to choose from

N

number of random elements to select from X

Value

a list, a vector

Examples

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)

[Package bispdep version 1.0-0 Index]