Questions tagged [pmap]
161 questions
2
votes
1 answer
Coding pmap in Solaris
I'm currently attempting to write my own program that mirrors the pmap command, specifically on Solaris 9. I'm having trouble resolving the names and paths of the libraries. Output of the Solaris command looks something like this, from a bash…

Dan Fego
- 13,644
- 6
- 48
- 59
2
votes
2 answers
Passing arguments to pmap in mutate
I have a problem with passing arguments to purrr::pmap when using with mutate.
I don't understand why some things work and some don't.
My example data:
sdf <- tibble(
col_id = c("id1", "id2", "id3", "id4", "id5", "id6", "id7", "id8", "id9",…

Radek Jaźwiec
- 51
- 5
2
votes
1 answer
Repeatedly sample without replacement in R loop
Working in R, using the familiar bag of coloured balls analogy. I want to sample without replacement from a bag of balls. In this bag, there are many differently coloured balls. Each colour, c, is represented a random number of times in the bag, k…

SGE
- 311
- 3
- 10
2
votes
2 answers
Is there a "next" equivalent in map()
When using for example a for loop I can use next to skip a certain item:
if (i == 5) next
print (i)
Is there a similar way to do this in a map() or more specifically in a pmap()?
a <- c(1,2,3)
b <- c(1,1,1)
c <- c(2,2,2)
mapped <-…

rbeginner
- 41
- 3
2
votes
2 answers
How to automate adding factors to variables in large data frame in R
I have a large data frame in R with over 200 mostly character variables that I would like to add factors for. I have prepared all levels and labels in an separate data frame. For a certain variable Var1, the corresponding levels and labels are…

ebay
- 109
- 1
- 7
2
votes
2 answers
Use columns of a data frame as arguments for a function using pmap
I'm trying to compute a function whose arguments are names of a column in a data frame. I need to loop over each row and compute the function. It seems pmap is a neat way to do this, but I'm forced to specify the " ..1, ..2, " notation to indicate…
2
votes
3 answers
R: purrr: using pmap for row-wise operations, but this time involving LOTS of columns
This is not a duplicate of questions like e.g. Row-wise iteration like apply with purrr
I understand how to use pmap() to do a row-wise operation on a data-frame:
library(tidyverse)
df1 = tribble(~col_1, ~col_2, ~col_3,
1, 5, …

dain
- 672
- 1
- 7
- 22
2
votes
2 answers
Iterate in R with a function that requires four vectors
I'm trying to find the distance between multiple cities using the distHaversine function in the geosphere package. This code requires a variety of arguments:
The longitude and latitude of the first place.
The longitude and latitude of the second…

J.Sabree
- 2,280
- 19
- 48
2
votes
3 answers
purrr::pmap for functions with multiple inputs and multiple return values
I am trying to set up a customized function with multiple inputs and multiple return values, and using this function with purrr::map on a data frame.
my sample data is:
test_data <-
tibble(x1 = 1:10,
x2 = 2:11,
x3 =…

Sam
- 89
- 10
2
votes
1 answer
JVM always reserved nearly 1G memory in my linux server according to pmap
I wrote a java class and run it in linux. JVM always reserve nearly 1G memory No matter how big the heap size is. I tried
java -Xms512m -Xmx512m MemTe
java -Xms100m -Xmx100m MemTe
java -Xms2048m -Xmx2048m MemTe
There is always a line in…

FFMan
- 73
- 5
2
votes
2 answers
Mapping a parameter tibble on to the function assign with pmap produces a list, not objects in the environment (as desired)
Preamble: A related SO question that I tried to emulate, but received the same (incorrect) result.
I'm trying to pass a tibble of parameters to assign via purrr::pmap. My parameter tibble has two columns: the name (chr), and the data (tbl_df). A…

Marian Minar
- 1,344
- 10
- 25
2
votes
4 answers
Julia - map function status
Is there a comfy way to somehow get the 'status' of map/pmap in Julia?
If I had an array a = [1:10] i'd like to either:
1: enumerate the array and use if-conditional to add a print command
((index,value) -> 5*value ......, enumerate(a)
and where…

isebarn
- 3,812
- 5
- 22
- 38
2
votes
1 answer
alpine linux: pmap output not showing RSS
I have a docker container running a base image of alpine linux and when I exec into the docker container and run the command:
pmap -x [pid]
The headers that I see in the output are:
Address Kbytes PSS Dirty Swap Mode Mapping
I am…

sunsin1985
- 2,437
- 5
- 22
- 27
2
votes
1 answer
pmap high memory usage by python script
I have a python script base daemon (listen on network for client connection) which is using lots of memory, its 23G almost. following is my pmap output:
[root@example ~]# pmap -x 9766 | grep anon
0000000001f64000 31140 31140 31140 rw--- […

Satish
- 16,544
- 29
- 93
- 149
2
votes
1 answer
how to get the memory mapping for a core on Linux/HPUX (pmap)
On solaris i can run the pmap command on a core file to get the memory map of a crashed process. Unfortunately the pmap command available on HPUX and Linux doesn't provide this option. Any pointers how i can get this information on these platforms?

Frank Meerkötter
- 2,778
- 2
- 20
- 26