Find Positions of Dots in Character String in R (3 Examples) | Locate Position | gregexpr & unlist

Описание к видео Find Positions of Dots in Character String in R (3 Examples) | Locate Position | gregexpr & unlist

How to locate all dots (i.e. points) in a character string in the R programming language. More details: https://statisticsglobe.com/find-posi...
R code of this video:

my_string <- "aaa.b.cccc.d.e" # Create example character string
my_string # Print example character string

all_dots <- unlist(gregexpr("\\.", my_string)) # Get all dot locations
all_dots # Return all dot locations

first_dot <- all_dots[1] # Extract first dot position
first_dot # Print first dot position

last_dot <- all_dots[length(all_dots)] # Extract last dot position
last_dot # Print last dot position

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – R Programming Group for Discussions & Questions:   / statisticsglobe  
Facebook – Python Programming Group for Discussions & Questions:   / statisticsglobepython  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – R Programming Group for Discussions & Questions:   / 12555223  
LinkedIn – Python Programming Group for Discussions & Questions:   / 12673534  
Twitter:   / joachimschork  

Music by bensound.com

Комментарии

Информация по комментариям в разработке