R markdown how to make data source text disappear

Hello, I have been using R markdown and flexdashboard to make html / web page, and somehow the textboxes that are associated with the files that I read in R studio for maps (they are all shapefiles, and these appear after the function readOGR). I have yet to find a solution to make these textboxes disappear. Let me know if there is a way to solve this?

Try setting message=FALSE in your chunk header; it should make the "textboxes" go away


wasn't able to solve the problem just with message=FALSE,
but found another article on stackoverflow that set verbose=FALSE in the readOGR chunk. so like:

layers <- readOGR(dsn= , " " , verbose =FALSE)

so if anyone else have similar problem with unsuppressed texts, this may solve the problem.

You are right; I have out of curiosity checked the source code of rgdal::readOGR() and it uses cat() for printing the output. This means it can not be suppressed by message = FALSE in chunk headers, as this works only for output printed by message() function.
I stand corrected.

BTW there is an interesting - if somewhat technical - discussion of the cat() vs message() issue on SO: https://stackoverflow.com/a/36700294/7756889

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.