V
learns numbersOnce upon a time there was a vector named V
that was
feeling empty and was trying to learn numbers from 0
through 9
. One day V
met the magical
combine function c()
that was able to add the numbers
inside V
, like this:
V <- c(1,2,3,4,5,6,7,8,9)
V
was very happy, and V
was now spending
its time enumerating the numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9. Sometimes
it would pick one at random:
8 and it was pleased that it was not always the same number coming
up.
V
wonders about itselfWanting to know itself better V
asked:
numeric
9
V
wants moreBut then V
wanted more: it wanted to add these
numbersbut not in the open like this, it wanted to do that “in its head”
so it could be done like this: 45 (and the value
will be printed here directly as calculate by R
.)
V
meets the Math WizardBut how to describe that to Math Wizards?
V
asked the beloved fairy friend Equation
who gave V
the magic codes:
\[\sum_{n=1}^{9} n = sum(V)\]
which is still 45.
V
in the land of vectorizationBut V
wanted more again… V
wanted to be 10
times more. So V
went on a journey across the land to know
what to do. It was a long and arduous journey, but V
ended
in the Land of Vectorization and there, V
was
augmented 100 times to be like this: 100, 200, 300, 400, 500, 600, 700,
800, 900. But it was cumbersome to feel these big numbers and
division helped one more time to make it just 10 times smaller
to be 10, 20, 30, 40, 50, 60, 70, 80, 90
V
and the mental pictureThis time V
wanted to have a mental “picture” of the
numbers and V
could think of 2 ways, the R
code had to be kept secret so that the code would not be
stolen:
It is useful to have friends that help you, and V
is
very grateful for the magical encounter with
c()
and other friends along the way.