I'm learning R in my Data-Driven Business course at my university, so it's brand new to me. I'm making a data project that analyzes data from a .csv file.
I have tried this, and it doesn't provide me with the right kind of result.
My problem is removing rows based on values from the column "Year_Birth".
I have tried:
# Read a csv file using read.csv()
csv_file = read.csv(file = "filtered_data.csv",
stringsAsFactors = FALSE, header = TRUE)
BabyBoomer = csv_file$Year_Birth[ csv_file$Year_Birth >= 1946 & csv_file$Year_Birth <= 1964]
head(BabyBoomer)
print::
[1] 1957 1954 1959 1952 1946 1946
y = csv_file$Year_Birth[csv_file$Year_Birth <= 1964]
BabyBoomer <- csv_file[-c(y), ]
head(BabyBoomer)
print:: df but without something changed
I would like to be able to create a subset with all rows deleted beside those <= 1964