Knitr dropping records
Knitr dropping records
I have a R package that was inherited after a person left. I realized after working through the file and code that the knitr file that is produced is dropping the last few records on the html table that's being built.
The problem:
the code is getting data in chunks of 10 records and then producing the table. I need to figure out how to get the remaining chunks in there.
Here is the code that's producing the data blocks
<!--begin.rcode echo=FALSE, results='asis', message=FALSE
overLevel <- 0
step <- 10
for(i in seq(1, nrow(exposures), by=step)) {
tryCatch({
tmp <- exposures[i:(i+step-1),]
cols <- ifelse( (as.numeric(gsub(",","",gsub(" ","",tmp$ARExcess)))) > overLevel, 'tomato',
ifelse(as.numeric(gsub(",","",gsub(" ","",tmp$MTMExcess))) > overLevel, 'lightyellow',
ifelse(as.numeric(gsub(",","",gsub(" ","",tmp$VolumeExcess))) > overLevel, 'azure3', 'white')))
cat(paste0('<h4><u>Exposures</u></h4>'))
cat(htmlTable(as.matrix(tmp), col.rgroup = cols, rnames = FALSE))
},error = function(e) {print(e)})
}
end.rcode-->
user2554330 why are you calling me a lier? I inherited this code, I'm not a developer of R stuff, I'm trying to fix it. I realize it's not knitr. I can't reproduce the code due to problems with the data being on a database. the issue is I need to see how to loop through the data break it up in chucks of 10 records then produce the Exposures header then continue onto the next records. I need simple help here not an ass-chewing about how I'm blaming knitr for the problem. Do you think you could lend some assistance?
– Sc-python-leaner
yesterday
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
I agree on the code, but don't know how to do what you are suggesting, could you help?
– Sc-python-leaner
Jun 29 at 19:37