--- title: "Your title" author: "Your name" date: "Today's date" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} cars=read.csv("./cars.csv",header = T, sep=";") head(cars) ``` # Data Analysis ## Get the cars having 8 cylinders ```{r } d=cars[cars$cyl==8] ``` ## Get the names of the cars having biggest horsepower ```{r } d=cars[cars$Horsepower==max(cars$Horsepower)] names=d['Car'] ``` ## Get all the cars made in Europe I don't know how I should write Europe ```{r } d=cars[cars$Origin=="Europe"] ``` #Data Visualization Visualize the evolution of the horsepower according to the numbers of cylinders ```{r } plot(cars$Cylinders,cars$Horsepower) ``` Visualize the ts of the weight and the acceleration ```{r } plot.ts(cars$Weight,cars$Acceleration) ``` Visualize the number of cars produced by origin I know we can avoid all of this by using ggplot, but I tried to do the group_by using R. However, the "undefined columns selected" error prevents me from visualizing the data. ```{r } made_in_Europe=length(cars[cars$Origin=="Europe"]) made_in_US=length(cars[cars$Origin=="US"]) made_in_Japan=length(cars[cars$Origin=="Japan"]) d=data.frame(Origin=cars$Origin,Number of cars=c(made_in_Europe,made_in_US,made_in_Japan)) hist(d) ```