Reversal of cell values

Hi there!
I have a matrix showing percentage values of people who have paid their bills, i want to convert these values so that the percentages of people who have not paid their bill is shown instead. In this way if a cell says 0.72 then I want it to change that cell to 0.28.
The data looks as follows
18 AM

I know this is probably an easy fix, but i'm having some trouble and hoping someone kind will help :slight_smile:

hi @naja

It more easy to help with a REProductible EXample. see here:

I test with an example of 2*2 numeric matrix. I've just done 1 - mymatrix

 
mat <- matrix(c(0.9,0.7,0.3,0.4), nrow = 2)
mat
#>      [,1] [,2]
#> [1,]  0.9  0.3
#> [2,]  0.7  0.4
1-mat
#>      [,1] [,2]
#> [1,]  0.1  0.7
#> [2,]  0.3  0.6

Created on 2019-12-13 by the reprex package (v0.3.0)

Hope it help

2 Likes

Thank you! that was an easy fix indeed! :slight_smile:

If your issue solve can u mark the solution please. (see the faq below)

Having questions checked as resolved makes it a bit easier to navigate the site visually and see which threads still need help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.