get the first element of the first list in a list of 48 lists. in r

To get the first element of the first list in a list of 48 lists, you can use indexing and subsetting in R.

Assuming your list is called my_list, you can use the double square brackets [[ operator to extract the first list, and then the single square brackets [ operator to extract the first element of that list:

main.r
first_element <- my_list[[1]][1]
33 chars
2 lines

This will assign the first element of the first list to the variable first_element.

Note that R uses 1-based indexing, so the first list is referred to as index 1, not 0.

gistlibby LogSnag