Add a new row in specific place in a dataframe

前端 未结 4 814
野的像风
野的像风 2020-12-29 11:18

Heres my data:

 > data
  Manufacturers       Models
1   Audi                RS5  
2   BMW                 M3  
3   Cadillac            CTS-V  
4   Lexus           


        
4条回答
  •  独厮守ぢ
    2020-12-29 11:50

    In case you don't want the index but rather a one-off "quick fix" for some spreadsheet-like appearance, you might resort to

    newData <- rbind( data[1:3,], Benz, data[ 4,] )
    

提交回复
热议问题