nc_read: Reading and Reshaping Network Canvas Data ('nc_read')

View source: R/nc_reader.R

nc_readR Documentation

Reading and Reshaping Network Canvas Data (nc_read)

Description

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.

Usage

nc_read(path, protocol = NULL, cat.to.factor = TRUE)

Arguments

path

A character value indicating the directory in which Network Canvas CSVs are located. nc_read will read in all CSV files located in this directory and process them.

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.

Value

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.


ideanet documentation built on April 3, 2025, 11:55 p.m.