On Jul 2, 2009, at 9:01 AM, Andriy Fetsun wrote:

Hi Guys,

It is very simple question, but I can't find the answer! Please help me.

I use R and such simple function as length() doesn't work. The result is
always 1 even if my data are more then 1 observations!

Do I have to load any additional library?

length(Ret_1)
[1] 1

Perhaps Ret_1 is not a vector? If Ret_1 is a data.frame with one column then this would be expected behavior. It is a result of data.frames really being lists. Perhaps you should try:

str(Ret_1) .... to see what sort of object you have created and then perhaps,

nrow(Ret_1)

length
function (x)  .Primitive("length")

If you type a function name you get the code or something informative about where to find the code.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
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