10.26 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.
## <0x55b6c5ee0d70>
## Variables:
##  * Date:          <0x55b6bfb49740>
##  * Location:      <0x55b6c289ed90>
##  * MinTemp:       <0x55b6c5ee01c0>
##  * MaxTemp:       <0x55b6c2d41200>
##  * Rainfall:      <0x55b6c4f83ef0>
##  * Evaporation:   <0x55b6c22ac5e0>
##  * Sunshine:      <0x55b6c5b63110>
##  * WindGustDir:   <0x55b6c7c4b480>
##  * WindGustSpeed: <0x55b6c7f81da0>
##  * WindDir9am:    <0x55b6c60c9540>
##  * WindDir3pm:    <0x55b6b7724910>
##  * WindSpeed9am:  <0x55b6c7c92290>
##  * WindSpeed3pm:  <0x55b6c74f41e0>
##  * Humidity9am:   <0x55b6b7244070>
##  * Humidity3pm:   <0x55b6c59c39c0>
##  * Pressure9am:   <0x55b6c38a0c80>
##  * Pressure3pm:   <0x55b6c5f908d0>
##  * Cloud9am:      <0x55b6bcbf5090>
##  * Cloud3pm:      <0x55b6c25d48b0>
##  * Temp9am:       <0x55b6c238cf30>
##  * Temp3pm:       <0x55b6c4781f00>
##  * RainToday:     <0x55b6c842d9e0>
##  * RISK_MM:       <0x55b6c3780720>
##  * RainTomorrow:  <0x55b6c2333770>
## Attributes:
##  * names:         <0x55b6c8069660>
##  * row.names:     <0x55b6bd620240>
##  * class:         <0x55b6c4714db8>
location(ds)
## <0x55b6c8544580>
## Variables:
##  * date:            <0x55b6c40ce670>
##  * location:        <0x55b6bb127960>
##  * min_temp:        <0x55b6c62f2910>
##  * max_temp:        <0x55b6c4910ba0>
##  * rainfall:        <0x55b6c4a69f30>
##  * evaporation:     <0x55b6c07bc5c0>
##  * sunshine:        <0x55b6c0915950>
##  * wind_gust_dir:   <0x55b6bb280cf0>
##  * wind_gust_speed: <0x55b6c0a6ece0>
##  * wind_dir_9am:    <0x55b6c3c68110>
##  * wind_dir_3pm:    <0x55b6c39f79f0>
##  * wind_speed_9am:  <0x55b6c0bc8070>
##  * wind_speed_3pm:  <0x55b6c68726b0>
##  * humidity_9am:    <0x55b6c644bca0>
##  * humidity_3pm:    <0x55b6c3e6d850>
##  * pressure_9am:    <0x55b6c69cba40>
##  * pressure_3pm:    <0x55b6c6b24dd0>
##  * cloud_9am:       <0x55b6c42b6ad0>
##  * cloud_3pm:       <0x55b6c3b04130>
##  * temp_9am:        <0x55b6c6c7e160>
##  * temp_3pm:        <0x55b6c6dd74f0>
##  * rain_today:      <0x55b6c6f30880>
##  * risk_mm:         <0x55b6c6fdd270>
##  * rain_tomorrow:   <0x55b6c7136600>
## Attributes:
##  * names:           <0x55b6c2570ae0>
##  * row.names:       <0x55b6bc65b1a8>
##  * class:           <0x55b6c619bdc8>


Your donation will support ongoing development 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.