- Hands-On Geospatial Analysis with R and QGIS
- Shammunul Islam
- 58字
- 2021-06-10 18:44:25
sapply
What we have got by using unlist(lapply(data, function, arguments_of_the_function)) can be obtained simply by using sapply(data, function, arguments_of_the_function).
sapply(all_prices4$june_price, power_function2, 4)
We are returned with a vector again as follows:

Now let's go back to the example of the all_prices3 data frame. We can see this from the screenshot that follows:
