Because I remember things better when I explain them, and because accessing elements inside a list in R is just barely different enough from other programming languages I'm used to that it's throwing me off with false cognates a bit -- here's a brief tour on basic ways to access objects in an R list. This is elementary R, but I'm a novice R programmer taking notes for my own reference, so hey.

Note that the ">" at the start of some lines is the R prompt ("stuff you should type"), but that you shouldn't type the ">." Everything else is print output that R will display to you.

First we need to create a list which we'll call `mylist`.

``` > mylist <- list(component = c(1,2,3)) ```

`mylist` is a super-simple list. Its contents look like this:

``` > mylist \$component  1 2 3 ```

This list only has one element. It is named `component`. (It also has one attribute, as Jerzy pointed out in the comments below -- the single attribute is called "names".)

``` > attributes(mylist) \$names  "component" ```

We can access the element named component in a few ways:

``` > mylist["component"] > mylist ```

One uses the element name, the other uses the index number. Both of these return a list, which looks like this when it's printed out -- note the `\$component` at the top. Inside the list is a vector of 3 numbers.

``` \$component #  1 2 3 ```

If you want to reach inside the list and get the stuff inside -- in this case, that vector of 3 numbers -- you can do it two ways as well: with the attribute name or the index number.

``` > mylist\$component > mylist[] ```

Both of them will return simply the vector -- it won't be wrapped in a list. Note how there's no `\$component` label at the top.

```  1 2 3 ```

Since `mylist\$component` and `mylist[]` return whatever is inside this list, and in this case it is a vector, we can access elements in it just like any other vector.

``` > mylist\$component > mylist[] ```

And you'll simply get that second number in the vector.

```  2 ```

I read on John Cook's "R langauge for programmers" that you can think of R lists as C-style structs. That's not too bad.

Side note: R typically gives you columns (for instance, `mymatrix` gives you the first column of `mymatrix`), but if you throw a comma afterwards it'll give you rows. (For instance, `mymatrix[1,]` gives you the first row of `mymatrix`). You can combine these: `mymatrix[c(1,2,3),c(1,2)]` gives you the first 3 rows of the first 2 columns of `mymatrix`.
{"ft_lang_label":"__label__en","ft_lang_prob":0.883908,"math_prob":0.635926,"size":2394,"snap":"2020-24-2020-29","text_gpt3_token_len":630,"char_repetition_ratio":0.13221757,"word_repetition_ratio":0.0,"special_character_ratio":0.267335,"punctuation_ratio":0.096114516,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95599186,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-05T09:27:46Z\",\"WARC-Record-ID\":\"<urn:uuid:60e42d1e-81cb-47f0-a6b3-dab0ffb32d20>\",\"Content-Length\":\"14615\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:543899be-011c-4503-b329-6a05ce71fdc4>\",\"WARC-Concurrent-To\":\"<urn:uuid:9af87767-0ffc-44fa-ba9c-d813bb935065>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"https://melchua.com/blog/2012/09/07/r-basics-accessing-elements-of-an-object/\",\"WARC-Payload-Digest\":\"sha1:RD3G4ZSQ6JO25XJX3SI3MYDCJV5WNZVH\",\"WARC-Block-Digest\":\"sha1:J7SFZQAQBILIITOD6MMPW3S2GDCTCALC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593655887319.41_warc_CC-MAIN-20200705090648-20200705120648-00200.warc.gz\"}"}