TextFile manupulation:
I will be starting out by saving the .txt provided to the same folder as the project. I’ll use the read_lines(“textfilename”) function of tidyverse/dplyr to read in the text file. I noticed the pattern of the text file to have the following pattern:
dash row —->row 1 (I ended up stripping this one off the bat)
header —–>row 1
header ——>row 2
dash row —–>row 3
player data—>row 4
player data —>row 5
dash row—>row 6
player data—–>row 7
player data——>row 8
dash row —–>row 9
Row 1 to row 3 can now just simply be stripped away by declaring a new variable and start saving it from line 4 of the txt file.
I also can use str_split and use | as a delimiter to break the rows into columns.
Trying to display playerDataFrame and ratingsDataFram was giving me error. Upon google search, I realize they were still just list of strings and characters the as.data.frame(do.call(rbind, playerDataFrame)) would help me convert them into actual data frames that I can then manipulate.
I’ll have to play around with the code to see which combination of join/ select/mutate would give me a better structure that I can then output using write_csv().