Reputation: 47
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?
Upvotes: 0
Views: 3355
Reputation: 887098
With tidyverse
, we could use column_to_rownames
from tibble
library(dplyr)
library(tibble)
df <- df %>%
column_to_rownames(var = "...1")
Upvotes: 2
Reputation: 388982
You can add the first column as rowname and then delete the first column.
rownames(df) <- df[[1]]
df[, 1] <- NULL
Upvotes: 1
Reputation: 76
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.
Upvotes: 3