I am trying to sort a data frame by year. I know this should be the easiest thing in the world but I just keep getting error after error and have no idea how to solve this problem. I've tried to do the "minimum reproducible example" or whatever but I don't know how to create a data frame to reproduce the problem and I am not allowed to post the information online. So the first problem I thought I solved is changed the year column to numeric because it was a factor. Anyway, please help I'm about to punch a hole in a wall.
library(readr)
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
library(tidyr)
library(stringr)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
library(reprex)
library(tidyverse)
library(quantreg)
#> Loading required package: SparseM
#>
#> Attaching package: 'SparseM'
#> The following object is masked from 'package:base':
#>
#> backsolve
sports_top25000 <- read.csv('index_sales_export_categories.csv')
#> Warning in file(file, "rt"): cannot open file
#> 'index_sales_export_categories.csv': No such file or directory
#> Error in file(file, "rt"): cannot open the connection
baseball_top25000 <- sports_top25000 %>%
select(graded_title,vcp_card_grade_id,category,year,date,price) %>%
filter(category == 'Baseball')
#> Error in eval(lhs, parent, parent): object 'sports_top25000' not found
baseball_top25000
#> Error in eval(expr, envir, enclos): object 'baseball_top25000' not found
prewar_baseball_top25000 <- baseball_top25000 %>%
transform(prewar_baseball_top25000, year = as.numeric(year)) %>%
prewar_baseball_top25000
#> Error in eval(lhs, parent, parent): object 'baseball_top25000' not found
head(prewar_baseball_top25000)
#> Error in head(prewar_baseball_top25000): object 'prewar_baseball_top25000' not found
Created on 2019-07-30 by the reprex package (v0.3.0)