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.r33 chars2 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