plot - 'x' must be numeric ERROR in R while trying to create a Leaf and Stem display -


i beginner @ r , i'm trying read text file contains values , create stem display, keep getting error. here code:

setwd("c:/users/michael/desktop/ch1-ch9 data/ch01") gravity=read.table("c:ex01-11.txt", header=t) stem(gravity)     **error in stem(gravity) : 'x' must numeric** 

the file contains this:

'spec_gravity' 0.31 0.35 0.36 0.36 0.37 0.38 0.4 0.4 0.4 0.41 0.41 0.42 0.42 0.42 0.42 0.42 0.43 0.44 0.45 0.46 0.46 0.47 0.48 0.48 0.48 0.51 0.54 0.54 0.55 0.58 0.62 0.66 0.66 0.67 0.68 0.75

if can help, appreciate it! thanks!

gravity data frame. stem expects vector. need select column of data set , pass stem, i.e.

## first column stem(gravity[,1]) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -