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.
## <0x558592b92da0>
## Variables:
##  * Date:          <0x55858293f620>
##  * Location:      <0x55858a2a5310>
##  * MinTemp:       <0x558592b921f0>
##  * MaxTemp:       <0x55858a708e00>
##  * Rainfall:      <0x558589eb7500>
##  * Evaporation:   <0x558586144220>
##  * Sunshine:      <0x55858a790600>
##  * WindGustDir:   <0x55857febca50>
##  * WindGustSpeed: <0x558583dce260>
##  * WindDir9am:    <0x55858a31d470>
##  * WindDir3pm:    <0x558587c44070>
##  * WindSpeed9am:  <0x55858272f7a0>
##  * WindSpeed3pm:  <0x558590fe6350>
##  * Humidity9am:   <0x558587a4e1e0>
##  * Humidity3pm:   <0x558590689ad0>
##  * Pressure9am:   <0x558583a126f0>
##  * Pressure3pm:   <0x5585868f51b0>
##  * Cloud9am:      <0x558580ef7bc0>
##  * Cloud3pm:      <0x558587c64130>
##  * Temp9am:       <0x558589bb4f80>
##  * Temp3pm:       <0x5585898ed210>
##  * RainToday:     <0x55858fd8afa0>
##  * RISK_MM:       <0x55858c69e900>
##  * RainTomorrow:  <0x55858c153a60>
## Attributes:
##  * row.names:     <0x5585908148c0>
##  * names:         <0x558589e1b920>
##  * class:         <0x55858f9ca128>
location(ds)
## <0x55858bc34690>
## Variables:
##  * date:            <0x558588f0f0f0>
##  * location:        <0x5585881a2280>
##  * min_temp:        <0x5585889193f0>
##  * max_temp:        <0x55858df80750>
##  * rainfall:        <0x55858e128650>
##  * evaporation:     <0x55858e2d0550>
##  * sunshine:        <0x55858e478450>
##  * wind_gust_dir:   <0x55858afad400>
##  * wind_gust_speed: <0x55858e620350>
##  * wind_dir_9am:    <0x55858b7046c0>
##  * wind_dir_3pm:    <0x55858b2772e0>
##  * wind_speed_9am:  <0x55858e7c8250>
##  * wind_speed_3pm:  <0x55858e970150>
##  * humidity_9am:    <0x55858bf29cc0>
##  * humidity_3pm:    <0x55858ba1c2a0>
##  * pressure_9am:    <0x55858eb18050>
##  * pressure_3pm:    <0x55858ecbff50>
##  * cloud_9am:       <0x55858aea8940>
##  * cloud_3pm:       <0x55858a8311e0>
##  * temp_9am:        <0x55858ee67e50>
##  * temp_3pm:        <0x55858f00fd50>
##  * rain_today:      <0x55858c019120>
##  * risk_mm:         <0x55858f1b7c50>
##  * rain_tomorrow:   <0x55858b0ec480>
## Attributes:
##  * class:           <0x55858d77be38>
##  * row.names:       <0x558590be1590>
##  * names:           <0x55858f3fcc10>


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-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0