Assume that I wish to hard-coding a data frame in R.
my_df = data.frame(list(Name=c("foo", "bar", "baz", "qux"),
Result=c("Hello", NA, "foobar", "World")))
If the data frame was a lot longer (e.g., if it were to comprise dozens of rows), it would not be immediately intuitive that baz
is associated with foobar
(i.e., that these two values share the same row).
Is there a visually more human-readable way of hard-coding a data frame in R?
EDIT 1:
To clarify my question, I am not looking for an alternative way to format the hard-coding of the data frame (such as aligning the two rows by spacing out the words with whitespaces). Instead, what I am looking for is a way to, for example, specify the data frame rowwise.