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.
## <0x55bed54fe8a0>
## Variables:
##  * Date:          <0x55becc2d8f50>
##  * Location:      <0x55becd2d0d10>
##  * MinTemp:       <0x55bed6fd38f0>
##  * MaxTemp:       <0x55bed46edf90>
##  * Rainfall:      <0x55bece70bad0>
##  * Evaporation:   <0x55bec55b5930>
##  * Sunshine:      <0x55bed87d8b00>
##  * WindGustDir:   <0x55becd2d18c0>
##  * WindGustSpeed: <0x55becd2ef2f0>
##  * WindDir9am:    <0x55bed46eeb40>
##  * WindDir3pm:    <0x55bece70c680>
##  * WindSpeed9am:  <0x55bed8ba4da0>
##  * WindSpeed3pm:  <0x55bed8c01860>
##  * Humidity9am:   <0x55bec55b64e0>
##  * Humidity3pm:   <0x55becf6075d0>
##  * Pressure9am:   <0x55bed35d99b0>
##  * Pressure3pm:   <0x55bed414c7a0>
##  * Cloud9am:      <0x55becd2efea0>
##  * Cloud3pm:      <0x55bed87d96b0>
##  * Temp9am:       <0x55bed6b8be60>
##  * Temp3pm:       <0x55bed3afee80>
##  * RainToday:     <0x55bed8ba5950>
##  * RISK_MM:       <0x55bed48d3950>
##  * RainTomorrow:  <0x55bed8c02410>
## Attributes:
##  * names:         <0x55bed5802cb0>
##  * row.names:     <0x55becfbbe618>
##  * class:         <0x55bed5dc58d8>
location(ds)
## <0x55bed33a0050>
## Variables:
##  * date:            <0x55becbc5ae00>
##  * location:        <0x55bed6ce1950>
##  * min_temp:        <0x55bed72e4350>
##  * max_temp:        <0x55bed703e4f0>
##  * rainfall:        <0x55bed12febc0>
##  * evaporation:     <0x55bed1457f50>
##  * sunshine:        <0x55bed15b12e0>
##  * wind_gust_dir:   <0x55bed3e5d9b0>
##  * wind_gust_speed: <0x55bed77370e0>
##  * wind_dir_9am:    <0x55becbdb4190>
##  * wind_dir_3pm:    <0x55bed3c0a570>
##  * wind_speed_9am:  <0x55bed7890470>
##  * wind_speed_3pm:  <0x55bed79e9800>
##  * humidity_9am:    <0x55bed4175590>
##  * humidity_3pm:    <0x55bed406ebb0>
##  * pressure_9am:    <0x55bed7b42b90>
##  * pressure_3pm:    <0x55bed180e0b0>
##  * cloud_9am:       <0x55bed6e3ace0>
##  * cloud_3pm:       <0x55bed3cf1d50>
##  * temp_9am:        <0x55bed1967440>
##  * temp_3pm:        <0x55bed1ac07d0>
##  * rain_today:      <0x55bed42ae8b0>
##  * risk_mm:         <0x55bed1c19b60>
##  * rain_tomorrow:   <0x55bed743d6e0>
## Attributes:
##  * names:           <0x55becd2d1eb0>
##  * row.names:       <0x55becb8ca570>
##  * class:           <0x55bed6cdfa88>


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.