formula_df is a dataframe that looks like so:
> formula_df
# A tibble: 4 × 4
lhs_new rhs_new f_new type
<chr> <chr> <chr> <chr>
1 A_rejected D_B+D_C+D_D+G_male+Q_unqualified A_rejected~D_B+D_C+D_D+G_male+Q_unqualified binary
2 D G_male D~G_male multi
3 G_male 1 G_male~1 binary
4 Q_unqualified 1 Q_unqualified~1 binary
x <- formula_df[2,'lhs_new']
# A tibble: 1 × 1
lhs_new
<chr>
1 D
How do I convert this to a string in R?
I tried:
str(x)
but when i call the folowing i get this:
class(str(x))
tibble [1 × 1] (S3: tbl_df/tbl/data.frame)
$ lhs_new: chr "D"
[1] "NULL"
formula_dfstrin R is a utility function to view thestructure of an object, do not confuse it with python'sstrfunction that tries to convert an object to a string.lhs_newcolumn is already of typecharacter(i.e., a string). What do you expect the output of this to be?quote(, it is unclear what part you want as string.,