Description Usage Arguments Note Author(s) References Examples
sapa.clean
1 | sapa.clean(data, database = "usa", DV = "g")
|
data |
|
database |
|
DV |
Please file bugs at https://github.com/frenchja/SAPATools/issues.
William Revelle <revelle@northwestern.edu> Maintainer: Jason A. French
https://sapa-project.org/r/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (data, database = "usa", DV = "g")
{
map <- map(database, plot = FALSE)
rangex <- map$range[2] - map$range[1]
rangey <- map$range[4] - map$range[3]
clean <- subset(data, (data[, "longitude"] > map$range[1]))
clean <- subset(clean, (clean[, "longitude"] < map$range[2]))
clean <- subset(clean, (clean[, "latitude"] > map$range[3]))
clean <- subset(clean, (clean[, "latitude"] < map$range[4]))
result <- data.frame(longitude = clean[, "longitude"], latitude = clean[,
"latitude"], DV = clean[, DV])
return(result)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.