skim: Skim a GDD table

Description Usage Arguments Examples

Description

Examine a random set of rows from a table, or a table subset

Usage

1
2
skim(x, table = NULL, column = NULL, n = 10, clean = TRUE,
  randomize = TRUE, setseed = NULL)

Arguments

x

A database connection or a query result.

table

A specific table within the database (if con is provided).

column

A specific column within a table (optional).

n

The number of rows to return

clean

Should word columns (if present) be cleaned using clean_words ('skip', replace', 'keep')?

randomize

Should the rows be a random sample from the larger dataset?

setseed

A value between -1.0 and 1.0 to set the postgres random seed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
# Connect to a database:
library(RPostgreSQL)
library(geodiveR)

con <- dbConnect(drv = "PostgreSQL",
                 user = "postgres",
                 password = "postgres",
                 host = "localhost",
                 port = "5432",
                 dbname = "deepdive")

skim(con, 'sentences')

# Using the results of a gddMatch:
coords <- gddMatch(con,
                   table = 'sentences',
                   col = 'words',
                   pattern = '[\\{,][-]?[1]?[0-9]{1,2}\.[0-9]{1,}[,]?[NESWnesw],',
                   name = "decdeg",
                   rows = TRUE)

DT::datatable(skim(coords, setseed=0.5, clean = 'replace'), )

dates <- gddMatch(con,
                   table = 'sentences',
                   col = 'words',
                   pattern = paste0('(\\d+(?:[.]\\d+)*),((?:-{1,2})|(?:to)),',
                                    '(\\d+(?:[.]\\d+)*),([a-zA-Z]+,BP),'),
                   name = "decdeg",
                   rows = TRUE)

## End(Not run)

EarthCubeGeochron/geodiveR documentation built on May 25, 2019, 8:29 p.m.