insertEdgeList: Insert edge lists to mysql database.

Description Usage Arguments Details Value See Also Examples

View source: R/insertEdgeList.R

Description

'insertEdgeList' insert the edge list from the results of 'generateEdgeList'

Usage

1
2
insertEdgeList(conMysql, edgeList, tableName = "EdgeList",
  dateTableName = "EdgeList_date")

Arguments

conMysql

a MySQL connection

edgeList

an edge list, as obtained from 'generateEdgeList'

tableName

string with the name of the table used to store the edge list, defaulting to 'EdgeList'

dateTableName

string with the name of the table used to store the dates for pmids, defaulting to 'EdgeList_date'

Details

'edgeList' must come from the result of generateEdgeList. The edge list will be stored in the specified table, which must include column names 'Source' and 'Target'. The table will be created if it does not exist. Edges in the table with matching targets are first deleted. The assumption is that the 'edgeList' is a complete up-to-date edge list, and previous records are removed.

Value

a scalar numeric that specifies the number of rows affected by the statement. An error is raised when issuing a statement over a closed or invalid connection, if the syntax of the statement is invalid.

See Also

generateEdgeList for obtaining edgeList citation results

Examples

1
2
3
4
5
6
7
## Not run: 
# generate an edge list for a single article and then insert the data to the table called "edgelist"
res1 <- get_pmc_cited_in(21876761)
e2 <- generateEdgeList(res1)
insertEdgeList(conMysql, e2)

## End(Not run)

gdancik/pmc2nc documentation built on May 5, 2019, 7:09 a.m.