这是indexloc提供的服务,不要输入任何密码
Skip to content

Relationship betwen tm_facets and tm_animate #1160

@Nowosad

Description

@Nowosad

@mtennekes see the example below. My assumption is that the tm_facets first specifies the faceting grid, which is then animated based on another variable. However, currently, the tm_facets call is overwritten by tm_animate... What's your thinking on this?

library(tmap)

set.seed(323)
metro$group = as.factor(sample(1:3, nrow(metro), replace = TRUE))
metro$group2 = as.factor(sample(1:3, nrow(metro), replace = TRUE))

tm_shape(metro) +
  tm_bubbles(size.free = FALSE) +
  tm_facets(by = "group") +
  tm_animate(by = "group2")
#> [tip] Consider a suitable map projection, e.g. by adding `+ tm_crs("auto")`.
#> This message is displayed once per session.

Created on 2025-07-06 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions