I want to create a data frame that updates each time my script is run. I want one column to have the number and the other to have the date that it was recorded. Here is what I have so far.
# Packages
library(miniUI)
library(shiny)
library(shinyFiles)
library(taskscheduleR)
library(rvest)
library(dplyr)
library(magrittr)
# Read in data
team_trees <- read_html("https://teamtrees.org/")
# Number of Trees
count <- team_trees %>%
html_nodes("#totalTrees") %>%
html_attr("data-count")
total_trees <- count %>%
as.numeric()
# Columns for data frame
day <- Sys.Date()
data <- data.frame(total_trees, day)
data
How can I have this data frame update each time I run the script instead of replace the data frame?