text slitting in R
item<-c(“A”,”B”) Type<-c(“P400″,”1200C”) > test_df<-data.frame(item, Type) > test_df item Type 1 A P400 2 B 1200C test_df<-test_df |> tidyr::separate(Type, into = c(“A”, “B”), sep = “(?<=[0-9])(?=[A-Za-z])”) > test_df item A B 1 A P400 <NA> 2 B 1200 C Hi all, with tidyr::separate, I am able to split test_df$Type into number and text, the code splits […]
Splitting data frames that have already been split in R
I have working with a data frame that contains information on pitching data. Each pitcher has a certain different pitches (each person throws a different number of pitches) they throw. I am trying to first split the original data frame by a pitchers name and then I’m trying to take the data frames with just the pitcher and split each of the new data frames by the unique values in pitch type column.