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 .

--
David Winsemius

in this case
On Feb 9, 2009, at 5:13 AM, glenn wrote:

Is there a general method for finding out what "something" is in R please.



I have a list (bycontract) that;



is.list(bycontract3)

[1] TRUE



And an element of this list would be this say;



bycontract3[[1]]

[1]  22   3.2  -8 -17  49   3

[7]  30 -3 -21   8 3 12

[13]  49 19 -13  -2 25 39

[19] -12 -90 -1  15 -87 30



I can not seem to see what type of object this element is (is.list = FALSE) - also is there a way to take all the elements and just put them in just one
series please



Regards



glenn




        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to