I have the following dataframe
df
ID Timestamp Package Genre Name
1 01 com.abc NA NA
1 02 com.xyz NA NA
2 04 com.abc NA NA
Now the Package column has about 1000 unique packages on the basis of which I need to update the Genre and Name columns.
I know how to update these by using vectorized approach or by using within but this means I would have to iterate over all unique package names manually and I was hoping to find a sleeker solution.
Looking at switch function for column values and R Apply function depending on element in a vector, I was trying to make a switch function that could take in two arguements (package field and Genre field) and use switch statements to update. Not sure if it's the right way to go.