Last active
September 8, 2022 07:58
-
-
Save DrNickRedfern/a6092ae449ae0673c8122781fdb3e221 to your computer and use it in GitHub Desktop.
An illustration of vectorisation in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The red colour channel of an image using the [0, 1] scale | |
RED <- c(1.000 0.259 0.557 0.329 1.000 0.259 0.263 0.263 1.000 0.263) | |
# Convert RED to the [0, 255] scale by multiplying by 255 | |
red <- RED * 255 | |
# Inspect the rescaled object red | |
red | |
[1] 255.000 66.045 142.035 83.895 255.000 66.045 67.065 67.065 255.000 67.065 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment