Skip to content

Instantly share code, notes, and snippets.

@Nicktz
Created January 21, 2022 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nicktz/a85e92768d89325210ec05bec3d59fd0 to your computer and use it in GitHub Desktop.
Save Nicktz/a85e92768d89325210ec05bec3d59fd0 to your computer and use it in GitHub Desktop.
# This is the code to generate .RData file.
# Note - this will create the environment which, if loaded, works as is on my PC.
# See environment on right of your screen - it saves those elements.
# Keep this environment ONLY relevant to what you need help with (don't clutter - filter your df)
# E.g.
rm(list=ls())
library(tidyverse)
library(tbl2xts)
df <- tibble(x = rnorm(100))
save.image("Img.RData")
# On my PC, this can now be put in a folder, and read as follows:
load("Img.RData")
# NOW CRUCIAL::::
# Send a separate code file that contains the code that breaks.
# In it, show the code that I will use, libraries, etc... e.g:
#-------------------------------------------------
# Code file (sent separately)
#-------------------------------------------------
rm(list=ls())
library(tidyverse)
library(tbl2xts)
load("Img.RData")
df %>% mutate(y = max(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment