sfclassic2df_v2: Split stanford classic text string to a tibble

View source: R/sfclassic_general.R

sfclassic2df_v2R Documentation

Split stanford classic text string to a tibble

Description

Split stanford classic text string to a tibble

Usage

sfclassic2df_v2(strng, sfvardefs = stanfordclassicr::sfvardefs)

Arguments

strng

is a "stanfor classic file text string", i.e. the text string being the content of any StanForD classic machine report. The content is a long string which carries all the data. Stanford classic variables are separated by a "~", followed by two numbers defining the variable code and type, then followed by the variable values.

sfvardefs

is a tibble providing all stanford classic variable definitions found in the documentation. Columns: sfv is stanford variable number and type, e.g. "v1t1", and sfvc is variable category (character, integer, code)

Value

a data.frame, where each pair of StanForD code and corresponding variable values will form one column. I.e have one row

Examples

stanford_classic_string <-
"1 2 \nSTM~120 1 \nFURU \nGRAN~16 4 \n20160208064316~116 1 7 7 2 2"
sfclassic2df_v2(stanford_classic_string)

hbelbo/stanfordclassicr documentation built on Dec. 23, 2024, 2:45 p.m.