helpers: Functions to facilitate the creation of 'poplite'\'s data...

Description Usage Arguments Value Author(s) See Also Examples

Description

These functions facilitate the creation of TableSchemaList objects from existing or supplementary R data structures such as the data.frame.

Usage

1
2
3

Arguments

tab.df

A data.frame representing a database table

name

Desired name of the database table

dta.func

An optional function which will take a specified object and turn it into a SQLite table. The function parameters should have the same names as the objects supplied to populate.

...

Arbitary objects provided to the function specified in dta.func. They should be of the same type and be named like the objects to be passed to populate.

Value

makeSchemaFromData

A TableSchemaList object

makeSchemaFromData

A TableSchemaList object

correct.df.names

A data.frame with valid names for SQLite

Author(s)

Daniel Bottomly

See Also

TableSchemaList

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  if (require(Lahman))
  { 
    franches <- makeSchemaFromData(TeamsFranchises, name="team_franch")
    show(franches)
    
    makeSchemaFromFunction(function(x) head(x),  name="team_franch", x=TeamsFranchises)

    test.df <- TeamsFranchises
    names(test.df)[1] <- "franch.ID"
    
    names(test.df)
    
    names(correct.df.names(test.df))
  }
  

poplite documentation built on May 14, 2019, 1:02 a.m.