Type: Package
Title: Process Data from the Social Networks and Fertility Survey
Version: 0.1.2
Description: Processes data from The Social Networks and Fertility Survey, downloaded from https://dataarchive.lissdata.nl, including correcting respondent errors and transforming network data into network objects to facilitate analyses and visualisation.
Encoding: UTF-8
RoxygenNote: 7.2.3
Imports: haven (≥ 2.5.1)
Suggests: testthat (≥ 3.0.0), tidygraph (≥ 1.2.2)
Config/testthat/edition: 3
License: CC BY 4.0
URL: https://github.com/gertstulp/FertNet
BugReports: https://github.com/gertstulp/FertNet/issues
NeedsCompilation: no
Packaged: 2024-02-05 12:09:50 UTC; gert
Author: Gert Stulp ORCID iD [aut, cre]
Maintainer: Gert Stulp <g.stulp@rug.nl>
Repository: CRAN
Date/Publication: 2024-02-05 12:50:13 UTC

Change column types for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Change column types for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

change_column_types(data)

Arguments

data

Tibble which is the result of translate(read_data())

Value

Tibble with corrected column types and updated labels

Examples


read_data() |> translate() |> change_column_types()


Create dataframe of alter attributes based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframe of alter attributes based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_alter_attr(data)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

Value

Tibble with variable alter_attr which includes a dataframe with alter attributes for each respondent

Examples


data <- read_data() |> translate() |>
change_column_types() |> fix_errors() |> create_relation_labels()
create_alter_attr(data[1, ])


Create dataframe of edgelist based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframe of edgelist based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_edgelist(data = NULL, vars = NULL)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

vars

Vector with variable names of 25 variables describing alter-alter-ties

Value

Tibble with variable edgelist which includes a dataframe with edgelist for each respondent

Examples


data <- read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels()
create_edgelist(data[1, vars_alter_ties])


Create dataframes of alter attributes and edgelists and store them in list-columns for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframes of alter attributes and edgelists and store them in list-columns for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_nw(data)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

Value

Tibble with list-columns containing alter attributes and edgelists

Examples


read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels() |> create_nw()


Produces corrected relationship labels for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Produces corrected relationship labels for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_relation_labels(data)

Arguments

data

Tibble which is the result of fix_errors(change_column_types(translate(read_data())))

Value

Tibble in which data on relationship labels are corrected and improved

Examples


read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels()


Create tidygraph objects from social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create tidygraph objects from social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_tidygraph(data)

Arguments

data

Tibble which is the result of produce_data()

Value

Tibble with variable tidygraph that includes tidygraph objects for all respondents

Examples


produce_data() |> create_tidygraph()


Fixes reporting errors and inconsistencies in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Fixes reporting errors and inconsistencies in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

fix_errors(data)

Arguments

data

Tibble which is the result of ⁠change_column_types(translate(read_data())⁠

Value

Tibble in which data errors are fixed and data worries are flagged

Examples


read_data() |> translate() |> change_column_types() |> fix_errors()


Get respondent background variables (LISS: avars_201802_EN_1.0p.sav) for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Get respondent background variables (LISS: avars_201802_EN_1.0p.sav) for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

get_background_vars(file = "avars_201802_EN_1.0p.sav")

Arguments

file

Path to file avars_201802_EN_1.0p.sav (or renamed variant)

Value

Tibble of data with background variables for social networks and fertility data

Examples


get_background_vars()


Produces tidy dataset of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Description

Produces tidy dataset of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Usage

produce_data(
  tidygraph_col = FALSE,
  background_vars = FALSE,
  remove_timing_vars = TRUE
)

Arguments

tidygraph_col

Should a variable tidygraph be created that includes tidygraph object for each respondent? (default: FALSE)

background_vars

Should respondent background variables be added? Requires presence of avars_201802_EN_1.0p.sav (default: FALSE)

remove_timing_vars

Should variables on timing of survey responses be removed? (default: TRUE)

Value

Tibble of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Examples


produce_data()
produce_data(TRUE, TRUE, FALSE)


Reads-in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Reads-in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

read_data(file = "wj18a_EN_1.0p.sav")

Arguments

file

Path to file wj18a_EN_1.0p.sav (or renamed variant)

Value

Tibble of social networks and fertility data

Examples


read_data("wj18a_EN_1.0p.sav")


Remove variables related to timing of giving answers in survey

Description

Remove variables related to timing of giving answers in survey

Usage

remove_timing_vars(data)

Arguments

data

Tibble sent within function produce_data()

Value

Tibble without timing variables


Translate LISS variable names of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) into sensible English names

Description

Translate LISS variable names of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) into sensible English names

Usage

translate(data)

Arguments

data

Tibble which is the result of read_data()

Value

Tibble with sensible column names

Examples


read_data() |> translate()