First, you use the pipe %>%
incorrectly. That is the main problem.
Second, it is better to use mutate once instead of four times.
Also not sure why do you use as integer, but this is a solution for you.
Com %>% mutate(precipitation=as.integer(prcp),
averagetemperature=as.integer(avtemp),
populationsize=as.integer(size),
numberoflymediseasecases=as.integer(cases))
Output
prcp avtemp size cases precipitation averagetemperature populationsize numberoflymediseasecases
<dbl> <dbl> <dbl> <dbl> <int> <int> <int> <int>
1 40 30 2 100 40 30 2 100
2 50 32 3 200 50 32 3 200
3 60 21 4 300 60 21 4 300
4 70 2 5 400 70 2 5 400
5 80 30 6 500 80 30 6 500
If you do not want duplicate columns, select only new ones:
Com %>% mutate(precipitation=as.integer(prcp),
averagetemperature=as.integer(avtemp),
populationsize=as.integer(size),
numberoflymediseasecases=as.integer(cases)) %>%
select(precipitation, averagetemperature,
populationsize, numberoflymediseasecases)
Output
precipitation averagetemperature populationsize numberoflymediseasecases
<int> <int> <int> <int>
1 40 30 2 100
2 50 32 3 200
3 60 21 4 300
4 70 2 5 400
5 80 30 6 500
If you can mutate columns and assign a specific column type, using
Changing column types with dplyr
If you specify exactly what are you trying to do, I will try to help additionally.