R/relationship_perline.R

Defines functions relationship_perline

Documented in relationship_perline

#### relationship_perline function

#### Social Network Survey package
#### 7.23.2019
#### script to make a dataframe with each relationships per line

# create a function that separates out the dataframe
relationship_perline <- function(qualtricsoutput) {
  library(tidyverse)
  newdataframe <- qualtricsoutput %>%
    group_by(SubjectID) %>%
    summarize(Nodes = Please.select.all.the.people.who.your.child.sees.in.a.regular.week...Selected.Choice) %>%
    mutate(Nodes = strsplit(as.character(Nodes), ",")) %>%
    unnest(Nodes)
  newdataframe$Gender <- NA
  newdataframe$Race <- NA
  newdataframe$Age
  newdataframe$Language
  return(newdataframe)
}
nicoleburke/Social-Network-Survey documentation built on Oct. 1, 2021, 4:58 a.m.