Consider adding tm_mode as alias for tmap_mode
I've seen this multiple times when trying to teach tmap (at least 4 times in the last few weeks). People have a lot of trouble remembering that the syntax is different -- tmap_ instead of tm_
It would be much better for usability if this function also started with "tm".
Hi @angela-li,
take a look at https://github.com/mtennekes/tmap/issues/171. Several different prefixes were used in version 1 of tmap. They were merged into two groups, tm_ and tmap_ to make it easier for users to remember. tm_ are the layer functions, while tmap_ (e.g., tmap_mode(), tmap_save()) are the helper functions.
I do not know what is the best approach while teaching tmap, but maybe just stating this distinction at the beginning could be good enough.
Yes, I guess this is an open question! I can try to incorporate the discussion that they represent different things in my teaching.
What I've found is that it's hard for people coming from sf to tmap, because most of those functions start with "st_" (including some "helper" functions). It's not immediately clear that there's a "tmap_" set of functions to people. I'll see them typing "tm_", pressing Tab, and getting frustrated that they can't find how to change the mode.
I've also seen cases where longer-term tmap users didn't know about the tmap_ functions, possibly because they didn't think to use tmap_ as the prefix :)
I think once you know about the tmap_ prefix, it seems completely obvious, but it does create some friction when getting started, in terms of function discoverability.
Also, I'm suggesting that both could be used in a future release (ie. tm_mode will call the tmap_mode functions), not getting rid of the tmap_ functions entirely 👍
I think we will keep the tm_ vs tmap_ distinction, however, I will also try to highlight this the difference between these functions in the https://r-tmap.github.io/tmap-book/ book.