Can someone please explain why "0" is not included as the first unit to count when you do the order function? I have samples with IDs and they start at 0,1,2,3,4,...etc. When I do the order function, the ID numbers start at 1 rather than 0. Can someone explain why that is and also how to solve this problem?
I have a dataframe with several columns and one of the columns is ID and i want to sort the entire dataframe according to that column. The only thing is that I tried order, but it started at one. On excel, you can do custom sort and have it from smallest to largest. That's kind of what I am looking for, but I have tried everything and still nothing. Is there a way to do this?
UPDATE: So I learned what was going wrong. So the 0s were being eliminated due to running certain lines of code before others. I changed the order to be the ideal order of lines running, I fixed it and once I ran order()
again, this time it did start at 0 and did not delete the 0s. I know that this was a stupid mistake and oversight, and I apologize to all of you that had to read this atrocious question, especially since I am new to R. Thank you all for your help.