10.28 Effect on Data Storage

20180721 When the names of the variables within a dataset are changed R does not make a complete new copy of the dataset. Instead, the actual data in the column remains in tack whilst the variable itself (ds) references a new memory location where the new variable names get noted. The underlying data within the table is unaffected.

location(weather)
## Warning: `location()` was deprecated in dplyr 1.0.0.
## Please use `lobst::ref()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
## <0x559f36864b80>
## Variables:
##  * Date:          <0x559f322a1750>
##  * Location:      <0x559f33148b70>
##  * MinTemp:       <0x559f38a16be0>
##  * MaxTemp:       <0x559f2df687a0>
##  * Rainfall:      <0x559f2dde8da0>
##  * Evaporation:   <0x559f31213050>
##  * Sunshine:      <0x559f31213c00>
##  * WindGustDir:   <0x559f33149720>
##  * WindGustSpeed: <0x559f39425cf0>
##  * WindDir9am:    <0x559f368f2a40>
##  * WindDir3pm:    <0x559f2df69350>
##  * WindSpeed9am:  <0x559f394268a0>
##  * WindSpeed3pm:  <0x559f2df36b60>
##  * Humidity9am:   <0x559f2dde9950>
##  * Humidity3pm:   <0x559f2df37710>
##  * Pressure9am:   <0x559f331104d0>
##  * Pressure3pm:   <0x559f33111080>
##  * Cloud9am:      <0x559f2df37d00>
##  * Cloud3pm:      <0x559f33521fb0>
##  * Temp9am:       <0x559f335225a0>
##  * Temp3pm:       <0x559f33523150>
##  * RainToday:     <0x559f33523d00>
##  * RISK_MM:       <0x559f335242f0>
##  * RainTomorrow:  <0x559f33524ea0>
## Attributes:
##  * names:         <0x559f322c8120>
##  * row.names:     <0x559f2fc345c0>
##  * class:         <0x559f2534c858>
location(ds)
## <0x559f330970a0>
## Variables:
##  * date:            <0x559f28b05fd0>
##  * location:        <0x559f34a4fe80>
##  * min_temp:        <0x559f2e247730>
##  * max_temp:        <0x559f2e3a0ac0>
##  * rainfall:        <0x559f2e4f9e50>
##  * evaporation:     <0x559f2e6531e0>
##  * sunshine:        <0x559f2e7ac570>
##  * wind_gust_dir:   <0x559f301ab4d0>
##  * wind_gust_speed: <0x559f2e905900>
##  * wind_dir_9am:    <0x559f28c5f360>
##  * wind_dir_3pm:    <0x559f347eaf70>
##  * wind_speed_9am:  <0x559f2ea5ec90>
##  * wind_speed_3pm:  <0x559f3568bd00>
##  * humidity_9am:    <0x559f34ba9210>
##  * humidity_3pm:    <0x559f2ffff880>
##  * pressure_9am:    <0x559f357e5090>
##  * pressure_3pm:    <0x559f3593e420>
##  * cloud_9am:       <0x559f2efa9cd0>
##  * cloud_3pm:       <0x559f346aa850>
##  * temp_9am:        <0x559f35a977b0>
##  * temp_3pm:        <0x559f35bf0b40>
##  * rain_today:      <0x559f35d49ed0>
##  * risk_mm:         <0x559f35df68c0>
##  * rain_tomorrow:   <0x559f35f4fc50>
## Attributes:
##  * names:           <0x559f3b197040>
##  * row.names:       <0x559f2dc4ca50>
##  * class:           <0x559f346a8988>


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0