Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8282331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:20:16+00:00 2026-06-08T10:20:16+00:00

I have a list where each element is a 5*5 matrix. Eg [[1]] V1

  • 0

I have a list where each element is a 5*5 matrix. Eg

[[1]]   
           V1          V2          V3          V4          V5      
      [1,]   0.000000   46.973700   21.453500  338.547000   10.401600 
      [2,]  43.020500    0.000000  130.652000  840.526000   56.363700 
      [3,]  12.605600  173.238000    0.000000  642.075000   19.628100 
      [4,] 217.946000  626.368000  481.329000    0.000000  642.341000 
      [5,] 217.946000  626.368000  481.329000    0.000000  642.341000 
[[2]]   
           V1          V2          V3          V4          V5      
      [1,]   0.000000   47.973700   21.453500  338.547000   10.401600 
      [2,]  143.020500    0.000000  130.652000  840.526000   56.363700 
      [3,]  312.605600  17.238000    0.000000  642.075000   19.628100 
      [4,]  17.946000  126.368000  481.329000    0.000000  642.341000
      [5,] 217.946000  626.368000  481.329000    0.000000  642.341000  
...

How can I use an apply-like function to sum matrix [1] to [n], and return a 5*5 matrix as a result (each element is a sum of the corresponding elements in each of the matrix in the list) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:20:18+00:00Added an answer on June 8, 2026 at 10:20 am

    Use Reduce.

    ## dummy data
    
    .list <- list(matrix(1:25, ncol = 5), matrix(1:25, ncol = 5))
    
    Reduce('+', .list)
    ##       [,1] [,2] [,3] [,4] [,5]
    ## [1,]    2   12   22   32   42
    ## [2,]    4   14   24   34   44
    ## [3,]    6   16   26   36   46
    ## [4,]    8   18   28   38   48
    ## [5,]   10   20   30   40   50
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an unordered list and each list element contains a photo and a
I have a list of lists that looks like this: x[[state]][[year]] . Each element
I have a singly-linked list containing 1 value in each element. struct listElement {
OK, I have a list ( <ul> ) then inside each <li> element I
I have a list and each list element is inline. I add border to
I have a list -myList - where each element is a dictionary. I wish
So I have a list, each element of which is a numeric vector. Each
I have a list of elements around 1000. Each element (objects that i read
Say I have a list of integers, where each element is a number from
So I have a list that I will fade in each element of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.