r - aggregate function fails in knitr but succeeds in console -
i have following r code:
cleandata <- aggregate(x = stormdata[c("fatalities", "injuries")], = list(tolower(stormdata$evtype)), sum)
it runs fine in r studio console, when copy/paste in chunk in knitr
generates error:
error in `$<-.data.frame`(`*tmp*`, "harm", value = c(15, 0, 2, 2, 2, 6, : replacement has 902297 rows, data has 898 calls: <anonymous> ... withvisible -> eval -> eval -> $<- -> $<-.data.frame
i'm not sure why happening.
Comments
Post a Comment