It looks like you did not include a 2016 row in this dataset.
Is the approach below (mutate to create a new column, use the lag() function to compare to the prior year) helpful?
library(tidyverse)
#> Warning: replacing previous import 'vctrs::data_frame' by 'tibble::data_frame'
#> when loading 'dplyr'
data <- data.frame(
stringsAsFactors = FALSE,
year = c("2010", "2011", "2012", "2013", "2014", "2015"),
import = c(28137L, 32295L, 29255L, 29732L, 26480L, 25664L),
export = c(45033L, 58986L, 61325L, 52782L, 48684L, 39695L)
)
data %>%
mutate(ch_import_pct = round((100*(import - lag(import))/lag(import)),2),
ch_export_pct = round((100*(export - lag(export))/lag(export)),2))
#> year import export ch_import_pct ch_export_pct
#> 1 2010 28137 45033 NA NA
#> 2 2011 32295 58986 14.78 30.98
#> 3 2012 29255 61325 -9.41 3.97
#> 4 2013 29732 52782 1.63 -13.93
#> 5 2014 26480 48684 -10.94 -7.76
#> 6 2015 25664 39695 -3.08 -18.46
Created on 2020-09-09 by the reprex package (v0.3.0)