How to get warnings() output to string
问题 When I type warnings() to console, I get back Warning message: In fread(my_directory, ... : C function strtod() returned ERANGE for one or more fields. The first was string input '4.40589099726375E-309'. It was read using (double)strtold() as numeric However when I type as.character(warnings()) , I get: [1] "fread(my_directory)" My objective is to get the actual message displayed in warning() into a character string, so that I can pass it to the logwarn function in the logging package.