make the first row as header in r

# Read the data into a data frame
data <- read.table("your_file_path.csv", header = FALSE, sep = ",")

# Extract the first row as column names
col_names <- as.character(data[1, ])

# Remove the first row from the data frame
data <- data[-1, ]

# Set the extracted names as column names
colnames(data) <- col_names