Hello everybody,
I would like to ask for help. I have data like that.
data<-data.frame(stringsAsFactors=FALSE,
code = c("AAA2010", "AAA2010", "AAA2010", "AAA2010", "AAC2011",
"AAC2011", "AAC2011", "AAC2011", "AAD2010", "AAD2010"),
year = c("2010", "2010", "2010", "2010", "2011", "2011", "2011",
"2011", "2010", "2010"),
closed_price = c(49900L, 46600L, 46900L, 45200L, 45100L, 45600L, 46500L,
46100L, 46100L, 45800L),
stock = as.factor(c("AAA", "AAA", "AAA", "AAA", "AAC", "AAC", "AAC",
"AAC", "AAD", "AAD")),
date3 = as.factor(c("2010-12-15", "2010-12-16", "2010-12-19",
"2010-12-20", "2011-12-21", "2011-12-22",
"2011-12-23", "2011-12-26", "2010-12-27", "2010-12-28"))
)
I would like to filter the last day's stock price of each stock. My output is something like that.
I would appreciate any help.
Best regards,