Skip to content

problem/possible error with mirai_map #192

@kcmacstat

Description

@kcmacstat

In experimenting with mirai_map(), I do not understand why the documented example:
(mat <- matrix(1:4, nrow = 2L))
mirai_map(mat, sum)[.flat]

works fine, but:
(mat <- matrix(1:4, nrow = 2L))
mirai_map(mat, mean)[.flat]

gives the incorrect result of <1 2> instead of the expected <2 3>. What am I doing wrong? In the 2nd case, mirai_map only seems to be considering the first element of each row, rather than the whole row. Thanks in advance for your help...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions