Cleaning US Census data project: files.list function not working

I am currently learning R and I am stuck on the Cleaning US Census data project (https://www.codecademy.com/courses/learn-r/projects/r-data-cleaning-us-census).

Step 3 tells me to create a variable called files and set it equal to the list.files() of all the csv files you want to import.

On the walkthrough video ‘list.files’ comes up all in orange/red. In my code, the ‘list’ part before the full stop comes up in white and the ‘files’ part after the full stop comes up in orange/red (apologies, I’m a true beginner to coding so don’t know the proper names for all of these things).

The subsequent steps tell me to read the files using lapply() and then concatenate various data frames into one variable called us_census.

Step 6 is where my troubles start. When I try to print the column names, all I get back is ‘character(0)’. The video prints out all the actual column names. Then, when I try to inspect the structures, I get back ```
tibble [0 × 0] (S3: tbl_df/tbl/data.frame)
Named list()


I don't think I can get any further on this project without resolving this issue. I'm fairly sure that the problem starts at Step 3 but I really don't know how or why it isn't working for me. Any help would be much appreciated!!

This is the notebook as it currently stands, if that helps.


title: “Cleaning US Census Data”
output: html_notebook

# load libraries
library(readr)
library(dplyr)
library(tidyr)
# load CSVs
files <- list.files(pattern = "states_*.csv")
df_list <- lapply(files,read_csv)
us_census <- bind_rows(df_list)
# inspect data
print(colnames(us_census))


# drop X1 column



# remove % from race columns








# remove $ from Income column



# separate GenderPop column



# clean male and female population columns




# update column data types











# update values of race columns









# check for duplicate rows



# remove duplicate rows


# check for duplicate rows



# clean data frame