Here is an example of how you can use dplyr
and tidyr
packages to divide alternating rows in a table in R.
main.r472 chars16 lines
In this example, row_number()
is used to generate a sequence of row numbers, which are then filtered to select alternating rows. Finally, select()
is used to choose specific columns that are needed.
gistlibby LogSnag