R! remove element from list which start from specific letters -


i create list of files:

folder_gldas=dir(foldery[numeryfolderow],pattern="_obc.asc",recursive=f,full.names=t) 

unfortunately there 1 additional object remove (file name begin "nowy" - nowyevirainf_obc.asc).

how can find index of element on list remove typing: folder_gldas<=folder_gldas[-to_remove] ??

filter using regular expression.

folder_gldas <- folder_gldas[!grepl("^nowy", folder_gldas)] 

(you can swap grepl str_detect in stringr.)


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -