Once you grasp what how a data frame behaves you will be able to mimic the excel sheet in full. In this particular case what is happening is the following.
First you create a data.frame:
> x<- data.frame(a=5,b=6)
> x
a b
1 5 6
And so you now have one data frame x with two columns a and b.
But in your next step your are trying to get at a and b as separte objects (not columns) so this will not work. It will in fact give an error (unless you have assigned a value to a and b in a separate step.
> x$c <- a+b
Error: object 'a' not found
But here comes dplyr to the rescue to give you a readable way to do what you want. Consider:
library(dplyr)
x %>%
mutate(c = a + b)
The result will show a new column c with 11 as its value in the first row (the sum of a and b).
a b c
1 5 6 11
>
If you extend your dataframe with as many additional rows as you need, the mutate() approach will still work.