saving . . . saved Showing 0 to 0 of 0 entries under movies comedy tab of source window. has been deleted. Showing 0 to 0 of 0 entries under movies comedy tab of source window. has been hidden .
Showing 0 to 0 of 0 entries under movies comedy tab of source window.
Title
Question
Screenshot:- https://photos.app.goo.gl/i7iENquXvsnHz38r5


Script:-
library(dplyr)

# Clear R workspace<img>
rm(list = ls() ) 

# Declare a variable to read and store moviesData  
movies <- read.csv("moviesData.csv")

# View movies data frame
View(movies)
moviesComedy <- filter(movies,
                       genre == "comedy")
View(moviesComedy)

Console:-

> # Clear R workspace
> rm(list = ls() ) 

> # Declare a variable to read and store moviesData  
> movies <- read.csv("moviesData.csv")

> # View movies data frame
> View(movies)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> moviesComedy <- filter(movies,
+                        genre == "comedy")
> View(moviesComedy)
> moviesComedy <- filter(movies,
+                        genre == "comedy")
> View(moviesComedy)



R Data-Manipulation-using-dplyr-Package 06-07 min 20-30 sec 29-01-21, 1:45 p.m. Loki_Rajasthani

Answers:

Use the exact column names. You have written, "comedy" instead of "Comedy" with "C" capital.

Kindly try the following command -

filter(movies, genre == "Comedy")
29-01-21, 2:57 p.m. chrl3hr5@gmail.com
Thank you
29-01-21, 3:17 p.m. Loki_Rajasthani

Login to add comment


Log-in to answer to this question.