Regarding Matrix Operations
Title
Question
Apart from binding rows and cols using rbind and cbind , it would be more helpful, if the video suggests edit and delete operations on a matrix.
R Operations-on-Matrices-and-Data-Frames 11-12 min 50-60 sec
Answers:
Thank you for your suggestions. Editing and deleting can be achieved by indexing and slicing the required rows or columns.
We will definitely look into it. Meanwhile, you can learn to delete data from a matrix and a data frame by considering captaincy data frame used in various spoken tutorials of R from the example below -
Let us say we want to delete the 1st and 3rd columns from the captaincy data frame. To do so execute the following statement -
captaincy <- captaincy[c(-1,-3)]
If only 3rd column is to be eliminated then execute the following -
captaincy <- captaincy[-3]
If all columns from 1st to 3rd of the captaincy data frame are to be eliminated then we may execute the following statement -
captaincy <- captaincy[-1:-3]
Login to add comment