“cara menghapus kolom dalam tabel di r” Kode Jawaban

cara menghapus kolom di df di r

> df <- data.frame(x=1:5, y=6:10, z=11:15, a=16:20)
> df <- subset (df, select = -c(x:z))
> df
a
1 16
2 17
3 18
4 19
5 20
Cheerful Corncrake

Hapus kolom dari matriks r

# Remove third column - by column number
MyMatrix <- MyMatrix[,-3]

# Remove third and fifth columns - by feeding the matrix a boolean vector
MyMatrix <- MyMatrix[,c(TRUE,TRUE,FALSE,TRUE,FALSE,TRUE)]
YEGdad

cara menghapus kolom dalam tabel di r

# delete multiple columns in r 
# delete column in R by mapping Null value to them
dataset$firstcol <- dataset$nextcol <- dataset$anothercol <- NULL
Eager Eland

Jawaban yang mirip dengan “cara menghapus kolom dalam tabel di r”

Pertanyaan yang mirip dengan “cara menghapus kolom dalam tabel di r”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya