nc_read | R Documentation |
nc_read
)The nc_read
function reads in and processes CSV files produced by Network Canvas, a popular tool for egocentric data capture. nc_read
produces three dataframes optimized for use with ego_netwrite
.
nc_read(path, protocol = NULL, cat.to.factor = TRUE)
path |
A character value indicating the directory in which Network Canvas CSVs are located. |
protocol |
A character value indicating the pathname of the Network Canvas protocol file corresponding to the data being read. Reading in the protocol is optional but recommended for accurate encoding of categorical variables. |
cat.to.factor |
A logical value indicating whether categorical variables, originally stored as a series of TRUE/FALSE columns, should be converted into a single factor column. |
nc_read
returns a list containing three items: an ego list, an ego-alter edgelist, and an alter-alter edgelist. If multiple edge types exist for ego-alter and/or alter-alter ties, edgelists for each type of tie will be stored as individual data frames as elements in a list. All data frames are optimized for use with ego_netwrite
.
Note that in the alters
data frame(s), column node_type
reflects the "node type" assigned to a given alter as specified in a Network Canvas protocol. Values in node_type
are not necessarily those which should be fed into the alter_types
argument in ego_netwrite
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.