Martin, thank you for this.
After gather(), I want to pipe into a separate() function, since I need to split the column containing "Sepal.Length" into 2 columns, using the fullstop as the separator. This is what I did:
tidy = iris %>%
gather("Component", "Value", -Species) %>%
separate(Component, c("Component", "Quantity"), sep = ".")
This gives me this error:
Expected 2 pieces. Additional pieces discarded in 600 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...].
If remove the argument sep = "." from separate, the code runs fine.
Any idea what the issue may be?