nodify_col: nodify_col

Description Usage Arguments Details

Description

Shortcut to get unique values from a df column using unique_sep_values_of_col() and then create nodes from them.

Usage

1
nodify_col(df, col, label = "df_col_name", property_key = "Name", sep = ";")

Arguments

df

The data.frame containing the column of data.

col

The name of the data column, as a string.

label

The label to assign to these nodes. The default is to take this label from the name of the column. As a string.

property_key

The name for the property key for these values. Eg. "Name" for nodes labeled "Person". The default is "Name". As a string.

sep

The separator between items in a cell of the column, eg "," or ";"

Details

remember that label is the NODE label in Neo4j, and propery_key is the unique value that constrains nodes of that label.

So if your df has a column with names of items, eg lizard_species, that are unique names, this is perfect.

If the column is already named Lizard_Species (which is what you want as the Node label, ie :Lizard_Species) then you don't need to enter anything for label.

If you want the unique property value to be "Name" (ie. Lizard_Species.Name) then leave property_key blank.

If some rows have multiple items (eg, the row was tagged with multiple species) then set the sep and all you need to do is point this funtion at the df and column.


brendan-newlon/df2neo4j documentation built on Sept. 19, 2020, 5:44 a.m.