Search
 
SCRIPT & CODE EXAMPLE
 

R

drop columns by index r

#drop columns by index
df <- mydata[ -c(1,3:4) ]
#drop columns by name
df = subset(mydata, select = -c(x,z))
Comment

r remove column by index

DT[, coltodelete := NULL]
Comment

R drop columns

undesired <- c('mpg', 'cyl', 'hp')

mtcars <- mtcars %>%
  select(-one_of(undesired))
Comment

PREVIOUS NEXT
Code Example
R :: select columns without na in r 
R :: remove elements from character vector in r 
R :: r remove rows where value is 0 
R :: how to set the first column as row names in r 
R :: how to append in R list 
R :: glyph in r 
R :: how to transform days in years R 
R :: rnorm r 
R :: create file in r 
R :: r print concatenate 
R :: ggplot - blank title of axis 
R :: r concatenate data frame 
R :: round multiple columns in r 
R :: calculate correlation in r 
R :: r environment variables 
R :: change all columns type in R 
R :: find row with na r 
R :: How to extract the row with min or max values? in R 
R :: truncate string in r 
R :: knn accuracy in r 
R :: how to rename variables in r dplyr 
R :: r change column value conditionally 
R :: switch variable position in r dplyr 
R :: geom_jitter transparency 
R :: take node names from nodes to edges tidygraph 
R :: conditional mean statement r 
Rust :: read file buffer rust 
Rust :: rust reverse an array 
Rust :: rust const string 
Rust :: rust cargo error no override and no default toolchain set 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =