I have got a file that contains 1024 subjects, each have 3 data points. I need to find a corrupted data among them. I know for sure that there is just one data that is corrupted and it is quite evident when I look at the data but how do I do it through R? Need to find the row number that has the corrupted file. Thanks!
Okay, so say that your dataframe is Patients. In R just click ...
> View(Patients) # This gives you a spreadsheet view of your dataframe. > summary(Patients) # This gives you tabulated distribution of your columns.
Then you just click with your computer mouse on the top of the column that might be giving you the issue and it will realign all rows so that the highest datapoint is given in the first row and then the lowest data point is at the last row.
You didn't specify if the issue is a maximum or minimum outlier, but that's probably the issue.
You can also reorganize your data-frame with the order function with the argument ", decreasing = TRUE" in it, and sort.default is also a good way to do it particularly with respect to singular columns.
You can also use a boxplot to find the range of your error, so that you can use discretionary deletion.
If R is too advanced for you, then you can export your data.frame to a file as a comma separated values file (.csv) with "write.csv()", and edit it in Microsoft Excel or LibreOffice Calc, and then re-read it into R with "read.csv()" after you made some changes. If you do edit your data in a spreadsheet make sure every column has the same number of rows, or when you ask R to make a dataframe of your file then R will just proverbially scream at you.