sapa.clean: sapa.clean

Description Usage Arguments Note Author(s) References Examples

Description

sapa.clean

Usage

1
sapa.clean(data, database = "usa", DV = "g")

Arguments

data
database
DV

Note

Please file bugs at https://github.com/frenchja/SAPATools/issues.

Author(s)

William Revelle <revelle@northwestern.edu> Maintainer: Jason A. French

References

https://sapa-project.org/r/

Examples

 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)
  }

frenchja/SAPATools documentation built on May 16, 2019, 2:47 p.m.