I created an R object resultant from two tapply operations:
#getting first offer date for each fund
firstOfferDtByFund <- tapply(allEMNLSEFundsWithSymbols$first_offer_dt, allEMNLSEFundsWithSymbols$Symbol, min)
head(firstOfferDtByFund)
AANNX AASAX AASFX ACDHX ACDJX
NA 20100803 20081105 20080303 20111031 20111031
#getting the last date for each fund
lastDtByFund <- tapply(allEMNLSEFundsWithSymbols$caldt, allEMNLSEFundsWithSymbols$Symbol, max)
head(lastDtByFund)
AANNX AASAX AASFX ACDHX ACDJX
NA 20131231 20121231 20121231 20131231 20131231
I then combine those two objects to create an object with first and last dates available for various mutual fund data.
#now to combine the output
fundDateRange <- (cbind(firstOfferDtByFund,lastDtByFund))
head(fundDateRange)
firstOfferDtByFund lastDtByFund
NA NA
AANNX 20100803 20131231
AASAX 20081105 20121231
AASFX 20080303 20121231
ACDHX 20111031 20131231
ACDJX 20111031 20131231
All works well, but when I attempt to assign the mutual fund symbols to the combined object, I get a coercing message that system is attempting to coerce to a list
fundDateRange$Symbol <- rownames(fundDateRange)
Warning message:
In fundDateRange$Symbol <- rownames(fundDateRange) : Coercing LHS to a list
I am not trying to create a list, only a matrix or data.frame so I have can have mutual fund symbols aligned with beginning and ending data availability. I performed this operation a few weeks ago without that coercing warning. How do I create a data frame that contains mutual fund symbols and the associated dates without creating a list?