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.
## <0x56408273cee0>
## Variables:
##  * Date:          <0x56407cb0f170>
##  * Location:      <0x56408072c590>
##  * MinTemp:       <0x56407a551a80>
##  * MaxTemp:       <0x56407b733780>
##  * Rainfall:      <0x564078cf3f70>
##  * Evaporation:   <0x564078efac80>
##  * Sunshine:      <0x564076c5f9b0>
##  * WindGustDir:   <0x56408072d140>
##  * WindGustSpeed: <0x5640865546f0>
##  * WindDir9am:    <0x56407b734330>
##  * WindDir3pm:    <0x564078cf4b20>
##  * WindSpeed9am:  <0x56407dbc2cc0>
##  * WindSpeed3pm:  <0x56407de531b0>
##  * Humidity9am:   <0x564078efb830>
##  * Humidity3pm:   <0x564076c60560>
##  * Pressure9am:   <0x56407a56a910>
##  * Pressure3pm:   <0x5640758e2da0>
##  * Cloud9am:      <0x5640865552a0>
##  * Cloud3pm:      <0x56407dbc3870>
##  * Temp9am:       <0x56407ed3ec60>
##  * Temp3pm:       <0x56407e023620>
##  * RainToday:     <0x56407ca24840>
##  * RISK_MM:       <0x5640839db220>
##  * RainTomorrow:  <0x56407de53d60>
## Attributes:
##  * names:         <0x5640803b54e0>
##  * row.names:     <0x564081f03570>
##  * class:         <0x56407b085ea8>
location(ds)
## <0x56407a767a60>
## Variables:
##  * date:            <0x564080db2020>
##  * location:        <0x56407bbdd6c0>
##  * min_temp:        <0x564080fe8e60>
##  * max_temp:        <0x56407c7b4a10>
##  * rainfall:        <0x56407c2b5700>
##  * evaporation:     <0x56407f9c5070>
##  * sunshine:        <0x56407fb3aee0>
##  * wind_gust_dir:   <0x56407eeaea00>
##  * wind_gust_speed: <0x5640807f9960>
##  * wind_dir_9am:    <0x56407e937f20>
##  * wind_dir_3pm:    <0x56407ef82aa0>
##  * wind_speed_9am:  <0x56408096f7d0>
##  * wind_speed_3pm:  <0x564080ae5640>
##  * humidity_9am:    <0x56407e74fac0>
##  * humidity_3pm:    <0x56407e823b60>
##  * pressure_9am:    <0x56408134d600>
##  * pressure_3pm:    <0x5640814c3470>
##  * cloud_9am:       <0x56407f341b40>
##  * cloud_3pm:       <0x56407eaf56c0>
##  * temp_9am:        <0x5640816392e0>
##  * temp_3pm:        <0x564081c11310>
##  * rain_today:      <0x56407edccf80>
##  * risk_mm:         <0x564081d87180>
##  * rain_tomorrow:   <0x56408115ecd0>
## Attributes:
##  * names:           <0x56407a767860>
##  * row.names:       <0x56407985c820>
##  * class:           <0x5640807e2438>


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.