Basic tidying/factoring for simple grouped line plot

Hey all,

Could someone help me get started on working with an unfamiliar data structure? I have time-dependent data for which I need to factorize samples and groups, but I don't know how to get started. I'm not far enough to have a reprex, but this is the basic format of my data. Does it need tidying or can I work with it as is?

I appreciate any code jumpstarts!

is that a spreadsheet ?
get rid of the top row.
and change the animal names to reflect the groups
animal_1_1, animal_2_1,animal_3_2,animal_4_2

then load that to R

1 Like

Thanks @nirgrahamuk . Where I'm stuck is grouping the animals into a factor to call on it in ggplot, because it's across a row, and I've only ever called columns as factors. Also providing a factor name to the variable im graphing itself (cell index) which in tidier data I'm also used to having grouped in a column. Not sure if I should modify the formatting (unpreferable)

The next step I think is to use tidyr::pivot_longer()

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.