I am downloading data from census.gov using R library tidycensus data. then i am transforming data using spread(). Each geoid has many columns with estimate value, but it is producing NA for rest of the columns.
data after applying spread function
Please help me to correct the data.
Dput:
structure(list(GEOID = c(13001950100, 13001950100, 13001950100,
13001950100, 13001950100, 13001950100), NAME = c("Census Tract 9501, Appling County, Georgia",
"Census Tract 9501, Appling County, Georgia", "Census Tract 9501, Appling County, Georgia",
"Census Tract 9501, Appling County, Georgia", "Census Tract 9501, Appling County, Georgia",
"Census Tract 9501, Appling County, Georgia"), variable = c("S2401_C01_001",
"S2401_C01_002", "S2401_C01_003", "S2401_C01_004", "S2401_C01_005",
"S2401_C01_006"), estimate = c(1406, 271, 54, 54, 0, 0), moe = c(214,
87, 43, 43, 13, 13)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))