Thank you. Re-reading my own question, I can see that it was not very clear what I was trying to achieve, so let me try with one that is boiled down as much as possible.
If I name each element in my list, I can get the name of each list element using, for example, lmap, as follows:
library(tidyverse)
#> Registered S3 method overwritten by 'rvest':
#> method from
#> read_xml.response xml2
dfs <- list(mtcars = mtcars, iris = iris)
lmap(dfs, ~{message(names(.x));return(list(NULL))})
#> mtcars
#> iris
#> [[1]]
#> NULL
#>
#> [[2]]
#> NULL
Created on 2020-03-15 by the reprex package (v0.2.1)
What I am looking for is a way of getting the "called" element of the list without having to name each of them. This, for example, just gives my blanks (obviously because I have not named each element):
# Returns blanks
library(tidyverse)
#> Registered S3 method overwritten by 'rvest':
#> method from
#> read_xml.response xml2
dfs <- list(mtcars, iris)
lmap(dfs, ~{message(names(.x));return(list(NULL))})
#>
#>
#> [[1]]
#> NULL
#>
#> [[2]]
#> NULL
Created on 2020-03-15 by the reprex package (v0.2.1)
Is there a way of getting "mtcars" and "iris" from the list dfs <- list(mtcars, iris)? I know I have used data frames here, but I assume the same process would work for both data frames and functions