Learn R Programming

diyar (version 0.2.0)

to_s4: Change the returned outputs of diyar functions

Description

Convert the returned output of number_line, record_group, episode_group, fixed_episodes and rolling_episodes from a data.frame to number_line, pid or epid objects, and vice versa.

Usage

to_s4(df)

to_df(s4)

Arguments

df

data.frame

s4

pid or epid objects

Value

to_s4 - pid or epid objects

to_df - data.frame object

Examples

Run this code
# NOT RUN {
data(infections)
dates <- infections$date
output <- fixed_episodes(dates, case_length=30)
output

# from the a pid/epid object to a data.frame
df_output <- to_df(output)
df_output

# from a data.frame to pid/epid object
s4_output <- to_s4(df_output)
s4_output

all(s4_output == output)

# }

Run the code above in your browser using DataLab