-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcombined data.Rmd
68 lines (47 loc) · 2.12 KB
/
combined data.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "combined data"
author: "Fatemeh Nosrat"
date: "12/13/2018"
output: html_document
---
```{r }
#data in item_categories.csv
item_categories <- read.csv(file="/Users/fatemehnosrat/Desktop/Applied Regression/all-2/item_categories.csv",header = TRUE, na.strings=c("",".","NA"))
# a summary of item_categories
summary(item_categories)
# data in saless_train.csv
sales_train <- read.csv(file="/Users/fatemehnosrat/Desktop/Applied Regression/all-2/sales_train.csv",header = TRUE, na.strings=c("",".","NA"))
# a summary of sales_train
summary(sales_train)
#data in shops.csv
shops <- read.csv(file="/Users/fatemehnosrat/Desktop/Applied Regression/all-2/shops.csv",header = TRUE, na.strings=c("",".","NA"))
# a summary of shops.csv
summary(shops)
#data in items.csv
items <- read.csv(file="/Users/fatemehnosrat/Desktop/Applied Regression/all-2/items.csv",header = TRUE, na.strings=c("",".","NA"))
# a summary od shops
summary(items)
#data in test.csv
test <- read.csv(file="/Users/fatemehnosrat/Desktop/Applied Regression/all-2/test.csv",header = TRUE, na.strings=c("",".","NA"))
# a summary of test.csv
summary(test)
# loading plyr library, we need plyr to use "join"
library(plyr)
#join 2 data frames (sales_train and items) by their common column (item_id)
combined_data <- join (x = test, y = sales_train, by = c("shop_id"))
head(combined_data)
# a summary of combined_data
summary(combined_data)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.