I have df with thousands of tickers for different future contracts. They have an abbreviated name (which appears later) and a long name (which I want to have in another df)
full_list <- structure( list( Ticker = c("AC", "AIC", "BBS", "BO", "C", "DF"), Long_Name = c("Ethanol -- CBOT", "DJ UBS Commodity Index -- CBOT", "South American Soybeans -- CBOT", "Soybean Oil -- CBT", "Corn -- CBT", "Dow Jones Industrial Average -- CBT") ), .Names = c("Ticker", "Long_Name"), row.names = c(NA, 6L), class = "data.frame" )
This df has a list that I get daily. I have to go and find the abbreviated name and match it with the long name.
replace <- structure( list( Type = c("F", "F", "F", "F", "F", "F"), Location = c("US", "US", "US", "US", "US", "US"), Symbol = c("BO", "C", "DF", "AIC", "AC", "BBS"), Month = c("V13", "U13", "U13", "U13", "U13", "U13") ), .Names = c("Type", "Location", "Symbol", "Month"), row.names = c(NA, 6L), class = "data.frame" )
I'm looking for R to do this, replace the $ Symbol column and find these values ββin the full_list column of $ Ticker and add the column, replace $ Long_Name, where the corresponding full_list $ Long_Name will be rewritten. Hope this makes sense. I understand that column names are hard to understand.
This will be a simple VLookup in excel, but I have a script that I will use on a daily basis almost in R.