-
Notifications
You must be signed in to change notification settings - Fork 4
Description
(I have made more updates to Episode 2 and what I did today was added to the current Pull Request. Then I ran into this issue.)
What is the problem?
I saw that after the code is changed, we don't try to run it again!... This was also noted when we presented the Phython version. However, the code is not running perfectly... see details below.
EDIT: Quick fix is to move
library(lubridate)to the TOP of the script... But was this an intentional error???
Location of problem (optional)
Once I made the changes to the top of the script file eva_data_analysis.R to fix the hard-coded PATHs to script and Json data, I then try to run the code 3 different ways:
- By using
RSCRIPT eva_data_analysis.R - By using
sourceicon at the top right of Script pane in RStudio - By selecting all the text and issuing
Ctrl+returnto run the selected code (in this case the whole page.
I always get this error: Error in Date() : could not find function "Date"
However, if I manually issue the command on line 26 library(lubridate) FIRST, I get this info:
Attaching package: ‘lubridate’
The following objects are masked from ‘package:base’:
date, intersect, setdiff, union
AFTER that it all works well and I see the plot in the plot panel on RStudio, and also a file cumulative_eva_graph.png is visible in the directory with ls.
For the SHELL method, I can issue:
Rscript -e "library(lubridate); source('eva_data_analysis.R')"
and a file called Rplots.pdf is created and is correct.
Interestingly I do not have to do the same with library(jsonlite) on line 7.