My best guess is that R read the first line of the text file as data rather than a header value. The vector of ("Heights", 186, 190, 180, 179) is not numeric, but a vector named "Heights" that contains (186, 190, 180, 179( is numeric. I am sorry that I encountered your question so long after you entered it!
Thank you so much, really helpful. I have one doubt: Can you tell me what is a natural break in a histogram? I found in one research paper that the natural break in histogram of all values was used for deciding some cut-off value. How its is done?
A "natural break" means using the data to decide where the bin boundaries are. In my histograms, I generally ask the highest value and the lowest, then how many data points in total I have (so that we don't use bins that are much too narrow and are thus unpopulated). A natural break approach will ask where the points lie within the range to determine where to set the bin bounds. I haven't generally used that approach.
Hi, Sagar. If the hist() function returns that error, it means that the variable you are trying to plot hasn't been set properly (for example, the file didn't read into memory). Try this combo: a
I'm getting the error x must be a numeric, can u provide me alternative way?
My best guess is that R read the first line of the text file as data rather than a header value. The vector of ("Heights", 186, 190, 180, 179) is not numeric, but a vector named "Heights" that contains (186, 190, 180, 179( is numeric. I am sorry that I encountered your question so long after you entered it!
Thank you so much, really helpful. I have one doubt: Can you tell me what is a natural break in a histogram? I found in one research paper that the natural break in histogram of all values was used for deciding some cut-off value. How its is done?
A "natural break" means using the data to decide where the bin boundaries are. In my histograms, I generally ask the highest value and the lowest, then how many data points in total I have (so that we don't use bins that are much too narrow and are thus unpopulated). A natural break approach will ask where the points lie within the range to determine where to set the bin bounds. I haven't generally used that approach.
what to do for a csv file? is it the same way sir ?
A CSV is also a text file, but it uses a delimiter of a comma rather than a tab. In your call to read.table, specify sep = ","
@@DavidTabb thank you sir
Excellent!
I'm getting the error x must be a numeric, can u please help me
Hi, Sagar. If the hist() function returns that error, it means that the variable you are trying to plot hasn't been set properly (for example, the file didn't read into memory). Try this combo: a
Thanks so much for this!
Really useful thank you