to.rds: Tranform an 'sample.RDS' object to an 'rds.data.frame'...

View source: R/to.rds.R

to.rdsR Documentation

Tranform an sample.RDS object to an rds.data.frame object.

Description

This function transforms an output from the sample.RDS function of the RDStreeboot package to an rds.data.frame object of the RDS package.

Usage

to.rds(RDS.data)

Arguments

RDS.data

A list containing the following objects:

nodes

a numeric vector containing IDs

edges

a list containing two vectors: node1 for the recruiter's ID and node2 for the recruit's ID.

traits

a data frame containing respondents' traits.

degree

a vector containing each node's degree, or number of social connections.

Value

An rds.data.frame object.

Author(s)

Mamadou Yauck <yauck.mamadou@uqam.ca> and Erica E. M. Moodie.

Examples

#Load the synthetic population network dataset.
data("pop.network")

#Draw an RDS sample from the simulated network using the sampleRDS function
#from the package RDStreeboot.
require(RDStreeboot)
RDS.samp <- sample.RDS(pop.network$traits, pop.network$adj.mat, 200, 10,
 3, c(1/6,1/3,1/3,1/6), FALSE)

#Tranform RDS.samp to an rds.data.frame object
require(RDS)
to.rds(RDS.data=RDS.samp)

Neighboot documentation built on June 1, 2022, 1:06 a.m.