Sunday, March 22, 2015

Renumbering rows after ordering in R

Many a times after data cleaning and reordering, the dataset row numbers get jumbled up. To solve the issue simple run the following command:

> row.names(myDataFrame) <- 1:nrow(myDataFrame)

Happy programming!!

No comments:

Interview Question Preperation : Find longest subarray whose sum is equal to K

Software Engineering Practice interview question Given a array of N elements. Find the length of Longest Subarray whose sum is equal to give...