I'm getting error messages trying to find summary statistics for my variables in my data sets:
**Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class "character" $ operator is invalid for atomic vectors Error in UseMethod("tbl_vars") : no applicable method for 'tbl_vars' applied to an object of class "character"**
And to speak more to the second error message when I try to use "[" instead of the dollar symbol, to try to make it a numeric value I get the error messages:
Error in "2007"["Total Actual Costs"] <- as.numeric("2007"["Total Actual Cost"]) : target of assignment expands to non-language object
and
Error in "2007"[["Total Actual Cost"]] : subscript out of bounds.
I fundamentally do not understand what's wrong, I used both an excel and CSV file. I tried changing the data value type to numerical in Excel for both of them. And I don't think that the size of the data set is a problem because I've used bigger, and I've also used much more sloppy data before so I don't think that's the issue either. I have attached all of my code below
Basically I'm trying to find a way to convert the variables into numerical format, and filter the data on FIPS code so I can have a set for both States and Counties for these years.
https://drive.google.com/open?id=1y7ISVmOKi1cWRcKNgKF7VYYNDEn0F8B1 link to my data
 ```
library(tidyselect)
library(openintro)
library(GGally)
library(dplyr)
library(e1071)
library(plotrix)
library(fastDummies)
library(ggplot2)
library(readxl)
library(tidyverse)
    '2007' <-read_xlsx("Medicare county 2007.xlsx", skip = 1)
    `2007` <- replace(`2007`,`2007` == "*",NA)
    '2008' <-read_xlsx("Medicare county 2008.xlsx", skip = 1)
    `2008` <- replace(`2008`,`2008` == "*",NA)
    '2009' <-read_xlsx("Medicare county 2009.xlsx", skip = 1)
    `2009` <- replace(`2009`,`2009` == "*",NA)
    '2010' <-read_xlsx("Medicare county 2010.xlsx", skip = 1)
    `2010` <- replace(`2010`,`2010` == "*",NA)
    '2011' <-read_xlsx("Medicare county 2011.xlsx", skip = 1)
    `2011` <- replace(`2011`,`2011` == "*",NA)
    '2012' <-read_xlsx("Medicare county 2012.xlsx", skip = 1)
    `2012` <- replace(`2012`,`2012` == "*",NA)
    '2013' <-read_xlsx("Medicare county 2013.xlsx", skip = 1)
    `2013` <- replace(`2013`,`2013` == "*",NA)
    '2014' <-read_xlsx("Medicare county 2014.xlsx", skip = 1)
    `2014` <- replace(`2014`,`2014` == "*",NA)
    '2015' <-read_xlsx("Medicare county 2015.xlsx", skip = 1)
    `2015` <- replace(`2015`,`2015` == "*",NA)
    '2016' <-read_xlsx("Medicare county 2016.xlsx", skip = 1)
    `2016` <- replace(`2016`,`2016` == "*",NA)
    '2017' <-read_xlsx("Medicare county 2017.xlsx", skip = 1)
    `2017` <- replace(`2017`,`2017` == "*",NA)
    '07state'<- filter(.data='2007','State and County FIPS Code',na.rm==TRUE)
    ```
 
    