The function "lengths" was first introduced in R version 3.2.0 and is called by map_size (and several other functions). Running with an earlier version of R results in the error message:
Error in map_size: could not find function "lengths"
One possible resolution is to make the dependency in the DESCRIPTION file R (>= 3.2.0).