R/fltmovie.R

Defines functions fltmovie

Documented in fltmovie

#' Filtering top rated movies by genre, budget and year
#'
#' This functions gives you the movies which have higher critics ratings than
#' %90 of the data
#'
#' @param gnr genre / "in quotations"
#' @param n   budget amount
#' @param yr  year / between 2007-2011
#' @return  movie names
#' @import stats
#' @export
#' @examples
#' \dontrun{
#' fltmovie("genre", budget in millions, year)
#' fltmovie ("Action",100,2009)
#'
#' }
#'

fltmovie <- function(gnr,n,yr){

  topminscore <- stats::quantile(movies$CriticsRatings,probs = 0.90,na.rm = TRUE)
  movies$Films[movies$Genre==gnr & movies$BudgetinMillions>n & movies$Year==yr &
                 movies$CriticsRatings>=topminscore]

}
unimi-dse/891a3f81 documentation built on Feb. 22, 2020, 10:30 p.m.