[R] Meaning of "Integer,19"

arun smartpink111 at yahoo.com
Mon Sep 2 18:22:52 CEST 2013


Hi,

If you check ?str()
str(zseq)
#List of 6
# $ : int [1:19] 1 2 3 4 5 6 7 8 9 10 ...
# $ : int [1:20] 1 2 3 4 5 6 7 8 9 10 ...
# $ : int [1:21] 1 2 3 4 5 6 7 8 9 10 ...
# $ : int [1:22] 1 2 3 4 5 6 7 8 9 10 ...
# $ : int [1:23] 1 2 3 4 5 6 7 8 9 10 ...
# $ : int [1:24] 1 2 3 4 5 6 7 8 9 10 ...
# - attr(*, "dim")= int [1:2] 2 3


Can access each list element by:
zseq[[1]]
# [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19


#Integer is the class and 19, 20, 21,... are the total number of elements

  lapply(zseq,unlist)
[[1]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19

[[2]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20

[[3]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21

[[4]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

[[5]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

[[6]]
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


A.K.

----- Original Message -----
From: David Epstein <David.Epstein at warwick.ac.uk>
To: r-help at r-project.org
Cc: 
Sent: Monday, September 2, 2013 11:42 AM
Subject: [R] Meaning of "Integer,19"

I tried example('apply'). Among the various examples, there was the following:

apply> z <- array(1:24, dim = 2:4)
apply> zseq <- apply(z, 1:2, function(x) seq_len(max(x)))
apply> zseq         ## a 2 x 3 matrix
     [,1]       [,2]       [,3]
[1,] Integer,19 Integer,21 Integer,23
[2,] Integer,20 Integer,22 Integer,24

The entry "Integer,19" seems to mean the list of integers [1:19], though I'm just guessing. Possibly it means some list of 19 integers.

Questions:
Is the notation "Integer,19" documented somewhere? I can't find it.
How might one proceed to find out the meaning of this notation if one didn't know it before?
The actual substance of my question is a request for advice on how, in general, to look for documentation in R.

I know about help.start(), help.search() and RSiteSearch(). Also, I know how to search the archives of r-help. Are there other methods of searching R that I should try?
Usually I get more hits than I can cope with.
Thanks










    [[alternative HTML version deleted]]

______________________________________________
R-help at 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.




More information about the R-help mailing list