I want to Importing data only for March 2022 by just use readr library.
oil_price_mar <- read_delim("oil_price_noname.txt", col_names = c("Date",
"Premium Diesel B7",
"High Diesel B7",
"High Diesel",
"High Diesel B20",
"E85",
"E20",
"91",
"95"), col_select = ???)
oil_price_mar
I tried to select by use col_select but it did not work. This is my data:
df=structure(list(V1 = c("16/5/2565", "12/5/2565", "7/5/2565", "6/5/2565",
"4/5/2565", "1/5/2565", "29/4/2565", "27/4/2565", "23/4/2565",
"19/4/2565", "9/4/2565", "8/4/2565", "5/4/2565", "2/4/2565",
"31/3/2565", "29/3/2565", "26/3/2565", "23/3/2565", "22/3/2565",
"17/3/2565", "15/3/2565", "10/3/2565", "9/3/2565", "8/3/2565",
"5/3/2565", "4/3/2565", "2/3/2565", "26/2/2565", "24/2/2565",
"19/2/2565", "18/2/2565", "16/2/2565", "12/2/2565", "8/2/2565",
"2/2/2565", "28/1/2565", "25/1/2565", "20/1/2565", "14/1/2565",
"11/1/2565", "8/1/2565", "5/1/2565"), V2 = c(40.36, 39.36, 39.36,
39.36, 39.36, 37.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96,
35.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96,
35.96, 35.96, 35.96, 35.96, 35.96, 35.76, 35.16, 34.56, 33.96,
33.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.96, 35.86,
35.86, 35.46, 35.06), V3 = c(31.94, 31.94, 31.94, 31.94, 31.94,
31.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.74, 29.14, 28.54, 27.94, 27.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.84, 29.84, 29.44,
29.04), V4 = c(31.94, 31.94, 31.94, 31.94, 31.94, 31.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.74, 29.14, 28.54, 27.94, 27.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.84, 29.84, 29.44, 29.04), V5 = c(31.94,
31.94, 31.94, 31.94, 31.94, 31.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.74, 29.14,
28.54, 27.94, 27.94, 29.94, 29.94, 29.94, 29.94, 29.94, 29.94,
29.94, 29.84, 29.84, 29.44, 29.04), V6 = c(35.24, 34.24, 34.74,
34.24, 33.44, 32.84, 31.84, 31.04, 31.84, 31.24, 30.44, 31.04,
30.54, 31.14, 31.64, 32.24, 32.74, 32.14, 31.54, 30.94, 31.94,
32.34, 31.54, 30.54, 29.94, 29.34, 28.74, 28.74, 28.34, 27.94,
28.34, 28.34, 27.74, 27.24, 26.74, 26.14, 25.54, 24.94, 24.64,
24.34, 24.14, 24.14), V7 = c(40.84, 40.24, 40.74, 39.94, 39.14,
38.54, 38.54, 37.74, 38.54, 37.94, 37.14, 37.74, 37.24, 37.84,
38.34, 38.94, 39.44, 38.84, 38.24, 37.64, 38.64, 39.04, 38.24,
37.24, 36.64, 36.04, 35.44, 35.44, 35.04, 34.64, 35.04, 35.04,
34.44, 33.94, 33.44, 32.84, 32.24, 31.64, 31.14, 30.64, 30.24,
30.24), V8 = c(41.68, 41.08, 41.58, 40.78, 39.98, 39.38, 39.38,
38.58, 39.38, 38.78, 37.98, 38.58, 38.08, 38.68, 39.18, 39.78,
40.28, 39.68, 39.08, 38.48, 39.48, 39.88, 39.08, 38.08, 37.48,
36.88, 36.28, 36.28, 35.88, 35.48, 35.88, 35.88, 35.28, 34.78,
34.28, 33.78, 33.28, 32.88, 32.38, 31.88, 31.48, 31.48), V9 = c(41.95,
41.35, 41.85, 41.05, 40.25, 39.65, 39.65, 38.85, 39.65, 39.05,
38.25, 38.85, 38.35, 38.95, 39.45, 40.05, 40.55, 39.95, 39.35,
38.75, 39.75, 40.15, 39.35, 38.35, 37.75, 37.15, 36.55, 36.55,
36.15, 35.75, 36.15, 36.15, 35.55, 35.05, 34.55, 34.05, 33.55,
33.15, 32.65, 32.15, 31.75, 31.75)), row.names = c(NA, -42L), class = "data.frame")