Skip to content
Prev 169771 / 398506 Next

(no subject)

You first need to look at the documentation for the mode, class and  
typeof functions. (This should have been covered early in any of the  
standard texts.)

You are using the function "[[" on a list with one element and it  
appears you are getting a vector.

Try:

is.vector(bycontract[[1]])

mode(bycontract)
class(bycontract)
typeof(bycontract)

this.thing <- bycontract[[1]]
mode(this.thing)
class(this.thing)
typeof(this.thing)

Now you have in "this.thing" what some people outside R might call  
"just one series", but R users would call a "vector". There are very  
useful indexed series objects of class "zoo", but it doesn't appear as  
though you are quite ready for that level of complexity. Install and  
load the zoo package for addition of that facility when you are ready .