I have uploaded the excel file into the R environment when I view(data) then this shows like
this red circle has "...1" which is not actually in the excel sheet, so how to delete it in the R?
I have uploaded the excel file into the R environment when I view(data) then this shows like
this red circle has "...1" which is not actually in the excel sheet, so how to delete it in the R?
If you just want to rename the first column:
colnames(data)[1] <- ""
Otherwise you can either sett it to Null
data[1] <- NULL
... or subset the dataframe ...
data <- data[,-1]
... but there are lots of ways to do this.
With tidyverse
, we could use column_to_rownames
from tibble
library(dplyr)
library(tibble)
df <- df %>%
column_to_rownames(var = "...1")
You can add the first column as rowname and then delete the first column.
rownames(df) <- df[[1]]
df[, 1] <- NULL