1

I am using 'R Presentation' from R Studio to create a slide show for my project. I am using the below code and whatever I do I am not able to get rid of the output message from the code. I do not want the progress message to be included in my presentation slide.

I have the below portion of code in a different chunk , but that did not help me either. I cleared cache and tried all stuffs, but could not get rid of the progress message.

Any idea how to get rid of the output message ?

sPDF <- joinCountryData2Map(subset(world_all, year==year.list[i]),joinCode = "ISO3 ,nameJoinColumn = "country_code" , mapResolution = "coarse",verbose=FALSE)

it generates below output message , which I do not want to show in my presentation slide

154 codes from your data successfully matched countries in the map 0 codes from your data failed to match with a country code in the map 90 codes from the map weren't represented in your data

mihai
  • 4,592
  • 3
  • 29
  • 42

2 Answers2

1

That did not work either. Then I went to the source code of that function and found that a "cat" command is being used to print the messages. So, I muted the cat command output using the below method , and it worked !!

capture.output( 'the whole function' , file='NUL' )

  • Can you explain your solution in more detail? Should we copy paste the whole function code inside `capture.output()`? – Marco Aug 25 '23 at 10:46
0

Yes; verbose=BOOL controls whether or not the progress messages are printed, not the final message. I'd suggest experimenting with wrapping the call in a call to suppressMessages, and seeing what happens.

Oliver Keyes
  • 3,294
  • 2
  • 14
  • 23