(1) I have a data frame called COPY that looks like this
COPY <- data.frame (year = c(values_here),
Ceremony = c(values_here),
Award = c(values_here),
Winner = c(values_here),
Name = c(values_here),
Film = c(values_here),
)
(2) Some of the entry in the name and film column for some rows are mixed up
(3) I created a vector of all the names in the wrong place using this code.
COPY$Film[COPY['Award']=='Director' & COPY['Year']>1930]->name
the entry's where the Award = director and the year is greater than 1930 the name and film columns are mixed
(4) Now I would like to replace COPY$Name
based on the conditions stated with my new name object. I tried this code.
replace(COPY$Name,COPY$Award =='Director' && COPY$Year>1930,name)
SO basically I'm trying to flip the Name and Film columns where the Award column == director and the year column is greater than 1930.