search for: str_extract

Displaying 20 results from an estimated 24 matches for "str_extract".

2019 Sep 23
5
Consulta
...ot;,sep=""))? prueba <-image_ocr(imagen, language = 'eng')? lineas<-unlist(str_split(prueba,pattern = "\n"))? lineasp<-unlist(str_split(prueba[2],pattern = "\r\n"))? ? newnom <- NULL? renglones <- NULL? for (nombre in archivos){? subgrupo <- str_extract(str_extract(nombre,pattern = subgrupo_rg),pattern = "[0-9]{1,3}")? imagen <- image_read_pdf(path=paste(ruta,"/",nombre,".pdf",sep=""))? prueba <-image_ocr(imagen, language = 'eng')? lineas<-unlist(str_split(prueba,pattern = "\n&quo...
2019 Sep 24
2
Consulta
...;-image_ocr(imagen, language = 'eng')? > lineas<-unlist(str_split(prueba,pattern = "\n"))? > lineasp<-unlist(str_split(prueba[2],pattern = "\r\n"))? > ? > newnom <- NULL? > renglones <- NULL? > for (nombre in archivos){? > subgrupo <- str_extract(str_extract(nombre,pattern = subgrupo_rg),pattern = "[0-9]{1,3}")? > imagen <- image_read_pdf(path=paste(ruta,"/",nombre,".pdf",sep=""))? > prueba <-image_ocr(imagen, language = 'eng')? > lineas<-unlist(str_split(prueba,pattern =...
2017 Aug 02
4
Extracting numeric part from a string
...ggling to extract the number part from below string : "\"cm_ffm\":\"563.77\"" Basically, I need to extract 563.77 from above. The underlying number can be a whole number, and there could be comma separator as well. So far I tried below : > library(stringr) > str_extract("\"cm_ffm\":\"563.77\"", "[[:digit:]]+") [1] "563" > However, above code is only extracting the integer part. Could you please help how to achieve that. Thanks,
2019 Aug 15
4
Feature request: non-dropping regmatches/strextract
...sults in mismatches in column length if reassignment is done without subsetting. For consistency with other R functions and compatibility with this use case, it would be nice if regmatches did not automatically drop empty matches and would instead insert an NA_character_ value (similar to stringr::str_extract). This alternative regmatches could be implemented through an optional drop argument, a new function, or mentioned in the documentation (a la resample in ?sample).? Alternatively, at the moment, there is a non-exported function strextract in utils which is very similar to stringr::str_extract. It...
2011 Feb 03
2
Sorting a Data Frame by hybrid string / number key
...struggling with is how to sort the categories (because I don't want them in a straight alphabetic order). library(stringr) d <- data.frame(instance = c("competition11","competition01","big_20","small_4","small_2","med_9")) id <- str_extract(d$instance, "\\d{1,}$") Any pointers would be gratefully received. Thanks, Alastair -- View this message in context: http://r.789695.n4.nabble.com/Sorting-a-Data-Frame-by-hybrid-string-number-key-tp3258283p3258283.html Sent from the R help mailing list archive at Nabble.com.
2011 Jul 07
1
Working with string
...ng is "fdahsdfcha163517253c463278643" or "fdahsdfcha163517253C463278643" or "fdahsdfcha163517253P463278643", "fdahsdfcha163517253p463278643" etc. I have tried using latest stringr package to accomplice that. Here is my try: > library(stringr) > str_extract("fdahsdfcha163517253c463278643", "[c]") [1] "c" But it seems that, above code fetching "c" from "fdahsdfcha" only. My goal is to understand what is there between above 2 set of numbers, "C/c/P/p"? Can somebody help me how to do that?...
2013 Nov 20
2
Functional Programming patterns
...http://patternsinfp.wordpress.com/ which is too heavy for me. There is a 'Pragmatic Programmer' book on such patterns for Scala and Clojure. Is there anything for R ? I wanted to code this. Is there a functional pattern in R for multiple 'if' loops like this ? if( is.na(str_extract(input,"T[^.]*")[1]) ){ }else{ Thanks, Mohan This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this ma...
2017 Aug 03
2
Extracting numeric part from a string
...":\"563.77\"" >> >> Basically, I need to extract 563.77 from above. The underlying number >> can be a whole number, and there could be comma separator as well. >> >> So far I tried below : >> >>> library(stringr) >> >>> str_extract("\"cm_ffm\":\"563.77\"", "[[:digit:]]+") >> >> [1] "563" >> >>> >> >> However, above code is only extracting the integer part. >> >> Could you please help how to achieve that. Thanks, > > >...
2023 Mar 31
1
Extraer texto de una columna en Excel
..., bien drenados, de textura franco arenosa a franco arcillo arenosa. Fertilidad natural media* Lo que quiero extraer sería: *franco arenosa a franco arcillo arenosa * Al final lo pude realizar de la siguiente manera: df <- read_excel("Agrologia.xlsx") df$Extracted_Text <- trimws(str_extract(df$CARACTERIS, "(?<=textura?(?:[^a-zA-Z]|s)).*?(?=\\.)")) Estoy abierto a cualquier sugerencia o comentario. Muchas gracias. On Fri, 31 Mar 2023 at 12:03, Carlos Ortega <cof en qualityexcellence.es> wrote: > Hola, > > Como no sé lo que querías, veo dos alternativas.....
2013 Jul 15
3
ayuda con stringr
....p.Baleares (Illes) [9] m.1.p.Barcelona m.1.p.Burgos [11] m.1.p.Cáceres m.1.p.Cádiz Y quiero extraer el nombre de la provincia. Estoy intentándolo con stringr y usando expresiones regulares, pero no doy con la tecla. Seguro que es fácil He probado algo como require(stringr) str_extract(datos$tipo,"[p][A-Za-z]+") Pero me devuelve todo NA.. ¿Alguna idea o sitio dónde pueda aprender algo sobre expresiones regulares? Saludos
2023 Mar 31
1
Extraer texto de una columna en Excel
...enosa a > franco arcillo arenosa. Fertilidad natural media* > Lo que quiero extraer sería: *franco arenosa a franco arcillo arenosa * > > Al final lo pude realizar de la siguiente manera: > > df <- read_excel("Agrologia.xlsx") > > df$Extracted_Text <- trimws(str_extract(df$CARACTERIS, > "(?<=textura?(?:[^a-zA-Z]|s)).*?(?=\\.)")) > > Estoy abierto a cualquier sugerencia o comentario. > > Muchas gracias. > > On Fri, 31 Mar 2023 at 12:03, Carlos Ortega <cof en qualityexcellence.es> > wrote: > >> Hola, >> >&...
2019 Aug 15
0
Feature request: non-dropping regmatches/strextract
...length if > reassignment is done without subsetting. > > For consistency with other R functions and compatibility with this use > case, it would be nice if regmatches did not automatically drop empty > matches and would instead insert an NA_character_ value (similar to > stringr::str_extract). This alternative regmatches could be implemented > through an optional drop argument, a new function, or mentioned in the > documentation (a la resample in ?sample). > > Alternatively, at the moment, there is a non-exported function strextract > in utils which is very similar to st...
2019 Aug 29
0
Feature request: non-dropping regmatches/strextract
...length if > reassignment is done without subsetting. > > For consistency with other R functions and compatibility with this use > case, it would be nice if regmatches did not automatically drop empty > matches and would instead insert an NA_character_ value (similar to > stringr::str_extract). This alternative regmatches could be implemented > through an optional drop argument, a new function, or mentioned in the > documentation (a la resample in ?sample). > > Alternatively, at the moment, there is a non-exported function strextract > in utils which is very similar to st...
2017 Aug 03
0
Extracting numeric part from a string
...> > "\"cm_ffm\":\"563.77\"" > > Basically, I need to extract 563.77 from above. The underlying number > can be a whole number, and there could be comma separator as well. > > So far I tried below : > >> library(stringr) > >> str_extract("\"cm_ffm\":\"563.77\"", "[[:digit:]]+") > > [1] "563" > >> > > However, above code is only extracting the integer part. > > Could you please help how to achieve that. Thanks, Using ?gsub: X <- "\"cm_f...
2017 Aug 03
0
Extracting numeric part from a string
...> > "\"cm_ffm\":\"563.77\"" > > Basically, I need to extract 563.77 from above. The underlying number > can be a whole number, and there could be comma separator as well. > > So far I tried below : > >> library(stringr) > >> str_extract("\"cm_ffm\":\"563.77\"", "[[:digit:]]+") > > [1] "563" > >> > > However, above code is only extracting the integer part. > > Could you please help how to achieve that. Thanks, library(readr) parse_number('"...
2019 Aug 29
2
Feature request: non-dropping regmatches/strextract
Thank you, I am aware that there are packages that can accomplish this. I mentioned stringr::str_extract as a function that does not drop empty matches. I think that the behavior of regmatches(..., regexpr(...))?in base R should permit an option to prevent dropping of empty matches both for sake of consistency with the rest of the language (missing data does not yield a dropped index in other sorts of...
2017 Aug 03
0
Extracting numeric part from a string
...t;>> >>> Basically, I need to extract 563.77 from above. The underlying number >>> can be a whole number, and there could be comma separator as well. >>> >>> So far I tried below : >>> >>>> library(stringr) >>> >>>> str_extract("\"cm_ffm\":\"563.77\"", "[[:digit:]]+") >>> >>> [1] "563" >>> >>>> >>> >>> However, above code is only extracting the integer part. >>> >>> Could you please help how to achi...
2013 Nov 01
2
Replace element with pattern
Hi, I have a data frame with one column and several rows of the form. "Peak Usage : init:2359296, used:15859328, committed:15892480, max:50331648Current Usage : init:2359296, used:15857920, committed:15892480, max:50331648|-------------------|" I tested the regex Current.*?[\|] in an online tester which greedily matches upto the first 'pipe' character Current
2019 Aug 29
0
Feature request: non-dropping regmatches/strextract
...wasn't quite sure how it should behave. This feedback should be helpful. Thanks, Michael On Thu, Aug 29, 2019 at 2:20 PM Cyclic Group Z_1 via R-devel <r-devel at r-project.org> wrote: > > Thank you, I am aware that there are packages that can accomplish this. I mentioned stringr::str_extract as a function that does not drop empty matches. I think that the behavior of regmatches(..., regexpr(...)) in base R should permit an option to prevent dropping of empty matches both for sake of consistency with the rest of the language (missing data does not yield a dropped index in other sorts of...
2023 Mar 31
0
Extraer texto de una columna en Excel
...*s*, cómo podría cambiar el siguiente código para que me extraiga tanto textura como texturas. Quedo muy atento, gracias. rm(list = ls()) library(readxl) library(stringr) library(openxlsx) setwd("~/INFO_DIEGO/R") df <- read_excel("Agrologia.xlsx") df$Extracted_Text <- str_extract(df$CARACTERIS, "(<=?textura?).*?\\.") write.xlsx(df, "modified_file.xlsx") -- *Aviso legal:* El contenido de este mensaje y los archivos adjuntos son confidenciales y de uso exclusivo de la Universidad Nacional de Colombia. Se encuentran dirigidos sólo para el uso del de...