From 43f3847dd1e8af6fbaee24249227b7a01410c498 Mon Sep 17 00:00:00 2001 From: kwd <“wkong@student.ethz.chgit config --global user.name “your-github-username“tomatoliao> Date: Wed, 7 Feb 2018 11:06:55 +0100 Subject: [PATCH 1/2] kwd --- kwd.Rmd | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 kwd.Rmd diff --git a/kwd.Rmd b/kwd.Rmd new file mode 100644 index 0000000..ba4d1ad --- /dev/null +++ b/kwd.Rmd @@ -0,0 +1,44 @@ +--- +title: "R-Beyond the Basics" +author: "fangxingyu" +date: "Feb 6th, 2018" +output: + html_notebook: + theme: cosmo + toc: yes + toc_float: yes + pdf_document: + toc: yes +--- + +This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. + +Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Cmd+Shift+Enter*. + + + +##Part 1: Import the data +###Read in the data transactions.csv. #### +```{r} +transactions <- fread("data/transactions.csv") +``` +###Change dates +```{r} +transactions[, TransDate:=dmy(TransDate, tz="UTC")] +``` +###Check the data +```{r} +head(transactions) +str(transactions) +summary(transactions) +``` + + +##Part 2: Aggregation of variables + +###Save the latest transaction as the object now in your R environment. #### + +```{r} +max.Date <- max(transactions[, TransDate]) +``` + From c8d7d75019c78b26b0bb1de603b20c1cfe1650da Mon Sep 17 00:00:00 2001 From: kwd <“wkong@student.ethz.chgit config --global user.name “your-github-username“tomatoliao> Date: Wed, 7 Feb 2018 11:28:01 +0100 Subject: [PATCH 2/2] print(1+2) --- print1+2.R | 1 + 1 file changed, 1 insertion(+) create mode 100644 print1+2.R diff --git a/print1+2.R b/print1+2.R new file mode 100644 index 0000000..30bafc3 --- /dev/null +++ b/print1+2.R @@ -0,0 +1 @@ +print(1+2) \ No newline at end of file