[R] Handling of arrays

Tony Plate tplate at acm.org
Tue Apr 24 18:23:05 CEST 2007

Try the following and look at what they return:


-- Tony Plate

laptopcss at gmx.de wrote:
> Dear R-Experts,
> I just imported a workspace from Matlab. I know that I can get the names of the imported variables with names(). It works. The variable "ca" consists of several elements. I want to get the names of the elements to handle my output better. But names(ca) doesn't work. Why? I did the following commands:
>> class(ca)
> [1] "array"
>> mode(ca)
> [1] "list"
>> dim(ca)
> [1] 66  1  1
>> length(ca)
> [1] 66
> How can I now get the names which are stored in ca? When I use the command "ca[18]" I receive the content which stands there but not the name collables which I wanted to extract. 
> Any ideas?
> Thanks, Corinna

More information about the R-help mailing list