Skip to content

The new function DT() used for chaining/piping drops data.frame rownames names #5430

@Kamgang-B

Description

@Kamgang-B

I noticed that the new function DT() drops row names when applied to data.frame.

df = mtcars[1:5, 1:2]
df
		   mpg cyl
Mazda RX4         21.0   6
Mazda RX4 Wag     21.0   6
Datsun 710        22.8   4
Hornet 4 Drive    21.4   6
Hornet Sportabout 18.7   8

df |> 
  DT(1:4, .SD)
  
   mpg cyl
1 21.0   6
2 21.0   6
3 22.8   4
4 21.4   6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions