This could be in a simple way :
step 1: Copy 1st row to header:
names(dat) <- dat[1,]
step 2: Delete 1st row :
dat <- dat[-1,]
More Related Contents:
- How to get summary statistics by group
- pivot_wider issue “Values in `values_from` are not uniquely identified; output will contain list-cols”
- Split date-time column into Date and time variables
- Change variable name in for loop using R
- What are the main differences between R data files?
- Inserting an image to ggplot2
- Remove Rows From Data Frame where a Row matches a String
- Date conversion from POSIXct to Date in R
- Sorting each row of a data frame [duplicate]
- R – add column that counts sequentially within groups but repeats for duplicates
- Using `geom_line()` with X axis being factors
- Means multiple columns by multiple groups [duplicate]
- Download a file from HTTPS using download.file()
- Print unicode character string in R
- Interpolate NA values
- Compile R script into standalone .exe file?
- Fill region between two loess-smoothed lines in R with ggplot
- How to speed up subset by groups
- Sort year-month column by year AND month
- Extract a column from a data.table as a vector, by position
- Using lapply to apply a function over list of data frames and saving output to files with different names
- Recognize PDF table using R
- Output a vector in R in the same format used for inputting it into R
- Working with neuralnet in R for the first time: get “requires numeric/complex matrix/vector arguments”
- Row-wise sum of values grouped by columns with same name
- Create binary column (0/1) based on condition in another column
- Importing a big xlsx file into R?
- How do you create vectors with specific intervals in R?
- R: apt-get install r-cran-foo vs. install.packages(“foo”)
- Round a POSIX date (POSIXct) with base R functionality