Hi there, I am new to R programming and was wondering if I could get some help on a problem I am stuck on. Currently I have two data frame. One is ign_temp, which has a list of video games titles (about 18,000) and corresponding platform they appear on (about 30+ types). There are some title entries that appear multiple times due to the fact of being released on multiple platform as part of it as shown below. This df was just filtered to only show title and platform from the original database which has numerous columns (id, url, release year, etc).
ign_temp:
title platform
LittleBigPlanet Playstation Vita
Splice Playstation Vita
NHL 13 Xbox
NHL 13 Android
Wild iPhone
Mark of the Ninja Xbox 360
Mark of the Ninja PC
.......
I have another data frame ign_revised which has sample set of the games from the dataframe above but have additional column values like score, year, etc. Each game only appears distinctly once per row and I have added new columns to the dataframe for the possible platform they appear on (after year column starting from Android going to Xbox One, around 24 platform) as shown below (condensed view):
ign_revised:
id score_phrase title score genre year Android Arcade ... Xbox One
315 Cool Abzu 7.5 Puzzle 2012 Android Arcade ... Xbox One
87 Poor Alan 5.0 Action 2014 Android Arcade ... Xbox One
.....
598 Great NHL 13 8.5 Sports 2013 Android Arcade ... Xbox One
Ign_revised is alphabetically ordered and the game platform columns (Android Arcade .. XboxOne) just have the platform name repeated for all 1600+ title that appear in this dataframe.
My main question is is there a way like a for loop such that from ign_revised, use title and the platform columns (Android Arcade ... Xbox) to match ign_temp with the corresponding title and platform, and change the values in ign_revised's columns of Android Arcade ... Xbox to instead show 1 (videogame title appears in that platform) or 0 if it doesnt. So it would like below:
ign_revised (Final Result):
id score_phrase title score genre year Android Arcade ... Xbox One
315 Cool Abzu 7.5 Puzzle 2012 0 1 ... 0
87 Poor Alan 5.0 Action 2014 0 0 ... 1
.....
598 Great NHL 13 8.5 Sports 2013 1 0 ... 1
In my actual ign_revised dataframe, title is in the 3rd column and Platform Names Starting with Android is 12th column, if that helps. Thank you!