Skip to contents

Deletes the first n character(s) of a character object.

Usage

rm1stchar(x, n = 1)

Arguments

x

Character, e.g, each element may represent the name of a single gauging station.

n

numeric, indicating the number of characters that have to be removed from the beginning of x

Value

character object of the same length as x.

Author

Mauricio Zambrano-Bigiarini, mzb.devel@gmail

See also

Examples

## Loading the monthly time series of precipitation within the Ebro River basin.
data(EbroPPtsMonthly)

# Getting the name of each gauging station.
names <- colnames(EbroPPtsMonthly)

# Removing the initial letter 'P' of the name of each gauging station.
rm1stchar(names)
#>   [1] "Date"  "9001"  "9008X" "9012"  "9015"  "9019"  "9027"  "9034"  "9037" 
#>  [10] "9041"  "9048"  "9056"  "9060"  "9063O" "9064A" "9064I" "9064"  "9065I"
#>  [19] "9069A" "9069"  "9072D" "9072H" "9072I" "9072J" "9072"  "9073I" "9074C"
#>  [28] "9076"  "9077E" "9078"  "9080C" "9080"  "9083"  "9085I" "9086"  "9087" 
#>  [37] "9091I" "9092"  "9093"  "9094U" "9095E" "9095"  "9103I" "9103"  "9103X"
#>  [46] "9105"  "9107"  "9118E" "9121"  "9131I" "9136"  "9139"  "9145A" "9145" 
#>  [55] "9155"  "9160"  "9164"  "9168"  "9170"  "9174"  "9175"  "9176"  "9182I"
#>  [64] "9185"  "9198"  "9199A" "9199"  "9200"  "9205"  "9207"  "9210"  "9215" 
#>  [73] "9223"  "9224"  "9228"  "9236E" "9236"  "9246"  "9247"  "9252"  "9255" 
#>  [82] "9257E" "9262"  "9269"  "9279"  "9290"  "9293"  "9301"  "9305"  "9309" 
#>  [91] "9311A" "9311"  "9317"  "9318"  "9322"  "9329"  "9330"  "9331F" "9333" 
#> [100] "9348"  "9350A" "9353"  "9354"  "9356E" "9356I" "9359"  "9360"  "9370" 
#> [109] "9371"  "9372"  "9375"  "9377"  "9380"  "9381"  "9388"  "9390"  "9392" 
#> [118] "9399"  "9400"  "9401"  "9405E" "9408"  "9414"  "9416A" "9420"  "9421" 
#> [127] "9422"  "9424E" "9425F" "9425I" "9425"  "9426"  "9427A" "9427"  "9428" 
#> [136] "9433O" "9434"  "9440E" "9443"  "9446E" "9446"  "9451"  "9452"  "9460" 
#> [145] "9463"  "9470E" "9474"  "9476"  "9477"  "9478"  "9480"  "9481"  "9484" 
#> [154] "9485"  "9487"  "9489"  "9491"  "9492"  "9495F" "9495"  "9496"  "9497E"
#> [163] "9497"  "9499"  "9503U" "9507"  "9509"  "9510A" "9521"  "9522"  "9523" 
#> [172] "9528"  "9532"  "9539"  "9542"  "9544"  "9548"  "9553"  "9559"  "9562" 
#> [181] "9567E" "9571"  "9572"  "9573"  "9575"  "9576"  "9577E" "9578"  "9579" 
#> [190] "9585"  "9601U" "9605"  "9619"  "9621"  "9635"  "9638"  "9647"  "9649" 
#> [199] "9650"  "9657"  "9675"  "9684"  "9688"  "9689"  "9690"  "9695"  "9696A"
#> [208] "9700"  "9701E" "9703E" "9704"  "9708"  "9710"  "9713"  "9717"  "9718" 
#> [217] "9726"  "9729"  "9734"  "9736"  "9738"  "9741"  "9744A" "9745"  "9749" 
#> [226] "9760E" "9766E" "9766"  "9768"  "9770E" "9771E" "9771"  "9772"  "9773" 
#> [235] "9777"  "9782"  "9784E" "9784"  "9787"  "9789A" "9789"  "9790"  "9791" 
#> [244] "9792"  "9793"  "9794"  "9796"  "9804"  "9805E" "9807"  "9808"  "9813" 
#> [253] "9814E" "9814"  "9815E" "9815I" "9815"  "9816"  "9817I" "9817"  "9818E"
#> [262] "9818I" "9819E" "9820E" "9821E" "9821I" "9824I" "9824O" "9829"  "9833" 
#> [271] "9840"  "9843"  "9849"  "9862"  "9864"  "9869E" "9874"  "9875"  "9878E"
#> [280] "9878"  "9886"  "9894"  "9895"  "9897"  "9898"  "9900"  "9901B" "9904I"
#> [289] "9906E" "9907E" "9907I" "9908"  "9910"  "9913"  "9914E" "9914I" "9914" 
#> [298] "9915"  "9916"  "9918"  "9920E" "9920I" "9920"  "9921"  "9927"  "9932" 
#> [307] "9941"  "9942"  "9943"  "9947"  "9948"  "9950"  "9951A" "9951"  "9952" 
#> [316] "9953E" "9953"  "9961"  "9968"  "9971"  "9972"  "9973"  "9974"  "9975" 
#> [325] "9979"  "9981A" "9984"  "9990"  "9991"  "9993I" "9997E" "9998"