r – Remove a row of data from memory

I have read a large file into R Studio using the Arrow Package. The data is 31~ million rows x 42 columns. When I use Glimpse() to view the dataset, I get an error:

Error: Invalid: In CSV column #17: Row #8265: CSV conversion error to int64: invalid value ‘Cit’

So, I want to remove the row #8265 naturally. But using df <- df[-8265, ] throws another error:

Error: Only slicing with positive indices is supported

So my question is, how do we get rid of row 8265?

Here is the actual code:

#load libraries
library(tidyverse)
library(arrow)

#load main nfirs data for 2022

 nationalcalls_2022 <- open_dataset("basicincident.txt", format = "text", delimiter = "^")
 #use glimpse to see the data: nationalcalls_2022 |>  glimpse()
 nationalcalls_2022 %>% glimpse()

 nationalcalls_2022 <- nationalcalls_2022[-8265,]

Read more here: Source link