I have a vector of text strings in the object imgs
. They only differ by the percentage expression in the string. For example, the string representing 5% is named stress_test_results_5pct_ar_uncollectable_small_grain_cooperatives.png
, where _5pct_
in the string corresponds to 5%. I have 17 strings in the vector and I would like to ensure the order beginning at 5% and ending at 85% is maintained.
data:
c("stress_test_results_10pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_15pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_20pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_25pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_30pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_35pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_40pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_45pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_50pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_55pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_5pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_60pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_65pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_70pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_75pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_80pct_ar_uncollectable_small_grain_cooperatives.png",
"stress_test_results_85pct_ar_uncollectable_small_grain_cooperatives.png"
)