R映射中的警告

时间:2016-05-30 04:12:54

标签: r maps knitr suppress-warnings

我正在尝试使用以下代码映射一堆国家/地区。

require(mapdata)

# get the names
cc <- map('world', names = TRUE, plot = FALSE)

take <- unlist(sapply(c("iran", "malaysia", "saudi arabia", "united arab emirates", "kuwait", "bahrain", "indonesia", "qatar", "sudan", "pakistan", "bangladesh", "turkey", "egypt", "united kingdom", "jordan", "brunei", "sri lanka", "oman", "yemen", "lebanon", "kenya"), grep, tolower(cc), value = TRUE))

suppressWarnings(map())

suppressWarnings(map('world', regions=take, fill=TRUE, col='red', add = TRUE))

我得到了我想要的,然而,Pdf版本在页面上打印了以下警告

####  # maps v3.1: updated 'world': all lakes moved to separate new ###  # 'lakes' database. Type '?world' or 'news(package="maps")'.  #

我使用suppressWarnings,但仍会打印警告。当我用knitr编织文档时,如何隐藏它?

0 个答案:

没有答案