3,553 questions
4 votes
2 answers
101 views
mutate(across(map())): Any way to include the column name in a .progress message from map()?
If you want to call a function that returns multiple values on a column of a data.frame, and append these values as new columns to the data.frame, you can mutate(map()) |> unnest_wider(). If it's ...
0 votes
1 answer
87 views
renaming columns within `map` dynamically using the values from a certain row
Taking the following data: library(tidyverse) df <- data.frame(id = c("a", "a", "a", "b", "b", "b"), x = c(NA, "...
2 votes
2 answers
353 views
`purrr::in_parallel` extremely slow for rowwise operation on data.frames
I was excited when I read about the latest update of purrr (1.1.0) with its in_parallel capabilities. I just happen to have a time-consuming data task that runs for several minutes, because: my data ...
2 votes
2 answers
134 views
Writing an Excel file in combination with purrr::map leads to an error
I have a simple list like library(tidyverse) library(openxlsx) mtcars |> group_split(cyl) And now I want to save each list as an Excel file to the folder specified in cyl like so: mtcars |> ...
1 vote
1 answer
122 views
R Reticulate does work with for loop but not purrr::map2
I want to remove passwords from several Excel files, so I specified a data frame with paths and passwords and then added some python code running with reticulate. When I pass that function to a for ...
0 votes
1 answer
84 views
Async calls to CLI tool in separate folders
I like to call a command line utility from R and parallelise the tool by calling several copies of it in different folders. Each call can have quite different runtimes, so I'd like to do this in an ...
0 votes
2 answers
81 views
how to extract dataframe name from a list using map
I tried to use 'map' to filter a list of dataset. how can I extract the name of dataframe, which is 'YYY' in my code. library(dplyr) library(purrr) df1 <- data.frame(var1=seq(1:10), var2=seq(1:10),...
0 votes
1 answer
79 views
Extracting & Joining Values from a Nested List to a single column in R [closed]
I have a deeply nested list that I am trying to extract into a simple df. Sample List df <- tibble::tribble( ~division, ~id, ...
1 vote
3 answers
153 views
Change output of the `purrr::map` function
I have this small function and want to apply it to a dataset using purrr::map(). It does what I expect it to do, but after the output it also prints a list of NULL, which I don't want. I would like to ...
1 vote
1 answer
94 views
Error handling for tidyr hoist in API call dplyr pipe when column type changes between calls
I'm working with the Jira Native API to bring in dashboard data to R for rectangularizing. The max results that can be returned each call is 100. I'm working with a small dashboard atm but am thinking ...
0 votes
0 answers
42 views
The execution of vectorized functions after purrr discarding the invoke function (tibble, map and exec) [duplicate]
In the process of learning this part: vectorised functions The current version of purrr has deprecated the invoke_map function, what is the problem with this latter code? I am really confused. sim <...
1 vote
1 answer
86 views
Using httr2::last_response() in conjunction with purrr::possibly()
I have an issue when working with httr2::last_response() and purrr::possibly() and I can't quite figure out how to resolve it, as other posts involving either httr2 or purrr::possibly doesn't really ...
1 vote
4 answers
123 views
How can I select specific items in a list that are not at the top level? [duplicate]
I'm trying to select specific items in a list that are not in the top level, and everything I can think of doesn't work the way I would expect. Here is a dummy list where what I do NOT want is item &...
-1 votes
1 answer
61 views
Imap with multiple ifelse for 3 tiems 4 subplots and facets rows and columns in R
Based on this post for gglikert. There the group1 column had 2 levels and group2 has 3. Now if i implement it with 3 levels in group1 and 4 levels in group2 library(ggstats) library(dplyr) library(...
0 votes
1 answer
46 views
How to aggregate over multiple data.frames using something like rbind R [duplicate]
I have a bunch of dataframes that contain individual-level person data for complex survey weight adjusted survey data at a state level. Say one for each state: df_1, df_2, ..., df_50 I have a ...