Hello,
I couldn't find append_data when trying the example from here. Was it removed? If yes, how can I append/merge a column from a data frame to a tmap object?
Thanks!
data(Europe)
f <- tempfile()
download.file("http://kejser.org/wp-content/uploads/2014/06/Country.csv", destfile = f)
domain_codes <- read.table(f, header=TRUE, sep="|")
unlink(f)
domain_codes <- subset(domain_codes, select = c("Alpha3Code", "TopLevelDomain"))
domain_codes$Alpha3Code <- toupper(domain_codes$Alpha3Code)
Europe <- append_data(Europe, domain_codes, key.shp = "iso_a3", key.data = "Alpha3Code",
ignore.na = TRUE)
# codes in the data, but not in Europe:
oc <- over_coverage()
oc$value
# European countries without appended data:
uc <- under_coverage()
qtm(Europe[uc$id,], text="name")
# plot the result
qtm(Europe, text="TopLevelDomain")
Error in append_data(Europe, domain_codes, key.shp = "iso_a3", key.data = "Alpha3Code", :
could not find function "append_data"
Never mind. I found out that I need to load tmaptools to get that function.
Most helpful comment
Never mind. I found out that I need to load
tmaptoolsto get that function.