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 8871619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:01:57+00:00 2026-06-14T18:01:57+00:00

I have a numeric data matrix that looks like below: (Matrix) Sample1 Sample2 Sample3

  • 0

I have a numeric data matrix that looks like below:
(Matrix)

            Sample1     Sample2       Sample3         Sample4

BD.1809   0.4275       -1.034         0.857757         -1.43362
BD.911    0.4455       -1.456         -0.472828        -0.643979
BP.12     0.03642      -0.9054        1.03334          -0.02428
BS.114    -0.3262      4.677          -0.92514         -0.2435
BS.130    -0.2335      -0.8661        -1.21435         -0.9759
BS.376    0.1937       -1.043         -0.320004        -0.691325

I have calculated the mean with the following code Mean<-mean(Matrix)

How would I replace each value in the matrix with the Mean?

can any one give me tips on how to do this? The row and column names are unknown as are the values themselves and the size of the matrix.

  • 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-14T18:01:59+00:00Added an answer on June 14, 2026 at 6:01 pm
    m <- matrix(1:10,nrow=2)
    > m
         [,1] [,2] [,3] [,4] [,5]
    [1,]    1    3    5    7    9
    [2,]    2    4    6    8   10
    
    > mean(m)
    [1] 5.5
    > m[,] <- mean(m)
    > m
         [,1] [,2] [,3] [,4] [,5]
    [1,]  5.5  5.5  5.5  5.5  5.5
    [2,]  5.5  5.5  5.5  5.5  5.5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a data frame, df, that looks like: f t1 t2 t3
I have a dataframe with numeric entries like this one test <- data.frame(x =
I have a Datagridview in my C# program that contain numeric data. I need
I have an xts numeric matrix that includes multiple days of minute interval series.
I have numeric data that I am getting from a database. They are all
I have the following function that will convert a string into a numeric data
i would like to compare numeric data in rows. for eg, i have a
i have to validate the data contains numeric or not and if it is
I have a data.frame with numeric values. How can I replace the each row
I have two Tables: Table 1: Questions : QuestionId NUMERIC Title TEXT Test Data

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.