I ran a function which produced the following messages:
[Output truncated]No imagary was found at location 13.51418,100.525398094512No imagary was found at location 13.5142126237624,100.519283133217No imagary was found at location 13.5142452475248,100.667925324763No imagary was found at location 13.5142778712871,100.633407407186No imagary was found at location 13.5143104950495,100.615685968347No imagary was found at location 13.5143431188119,100.438773863735No imagary was found at location 13.5143757425743,100.584423279119No imagary was found at location 13.5144083663366,100.518027443291No imagary was found at location 13.514440990099,100.675459782113No imagary was found at location 13.5144736138614,100.667897127582No imagary was found at location 13.5145062376238,100.632888261162No imagary was found at location 13.5145388613861,100.627567350767No imagary was found at location 13.5145714851485,100.495578874954trying URL 'https://maps.googleapis.com/maps/api/streetview?&location=13.5146041089109,100.687791167767&size=8000x5333&heading=0&fov=90&pitch=0&
However, when I ran sink()
and my function (details omitted here), the my_output.txt
file did not save the console output above. Does anybody know how to fix this so that warnings and messages are saved?
Code:
sink(file = 'my_output.txt')
MyFunction(...)
sink()
Note: I've looked at similar queries such as How to capture warnings with the console output? but suspect there's a simpler solution?