similar to: Processing a hierarchical string name

Displaying 20 results from an estimated 1000 matches similar to: "Processing a hierarchical string name"

2017 Sep 04
1
Dataframe Manipulation
Hello Ulrik, Can you please explain this code means how and what this code is doing because I'm not able to understand it, if you can explain it i can use it in future by doing some Lil bit manipulation. Thanks data_help <- data_help %>% mutate(Purchase_ID = 1:n()) %>% group_by(Purchase_ID) %>% do(split_items(.)) cat_help %>% gather("Foo",
2010 Aug 25
0
stringr: version 0.4
Strings are not glamorous, high-profile components of R, but they do play a big role in many data cleaning and preparations tasks. R provides a solid set of string operations, but because they have grown organically over time, they can be inconsistent and a little hard to learn. Additionally, they lag behind the string operations in other programming languages, so that some things that are easy to
2010 Aug 25
0
stringr: version 0.4
Strings are not glamorous, high-profile components of R, but they do play a big role in many data cleaning and preparations tasks. R provides a solid set of string operations, but because they have grown organically over time, they can be inconsistent and a little hard to learn. Additionally, they lag behind the string operations in other programming languages, so that some things that are easy to
2017 Mar 15
3
Crear una función
Hola. Estoy intentando crear una función pero no logro que termine de cerrar y mi manejo no permite que el google me ayude... n.reg.dep <- function(x, y) { etiqueta <- str_replace(nombres[Variable == y, Descripcion], "[ ]", "") tabla <- datos[, .N, by = .(etiqueta = A3a)] # tabla <- tabla[, Porc := round(N/sum(N)*100,1)] # % tabla[, PorcAc :=
2013 Sep 27
2
Locating inefficient code
Hi, I have been using R for a few months and I have this working code. Don't seen any problem but this takes a long time. So if I have about 30000 rows it takes a few minutes. If I have 100000 it does not seem to complete. Original Data: Proto Recv-Q Send-Q Local-Address Foreign-Address State tcp 0 0 172.20.100.2:60255
2017 Aug 31
0
Dataframe Manipulation
Hi Hemant, the solution is really quite similar, and the logic is identical: library(readr) library(dplyr) library(stringr) library(tidyr) data_help <- read_csv("data_help.csv") cat_help <- read_csv("cat_help.csv") # Helper function to split the Items and create a data_frame split_items <- function(items){ x <- items$Items_purchased_on_Receipts %>%
2015 Oct 08
2
Uso comodín
Hola, Si quieres cambiar todas las ocurrencias sería "*str_replace_all()*" de esa misma librería (stringr). Si no quieres usarla por cualquier motivo, puedes hacer lo mismo con la función "*gsub()*" que está en el paquete "base" (instalada por defecto en R). Gracias, Calos Ortega www.qualityexcellence.es El 8 de octubre de 2015, 11:58, Francisco Rodríguez
2017 Mar 15
4
Fwd: Crear una función
Estimado Mauricio Monsalvo R es un lenguaje medio complicado, no es orientado a objetos, aunque hay formas para un trabajo con objetos, por otro lado se puede definir una función o emplear 5 paquetes para lo mismo en dos líneas de código. Usted tiene 1500 líneas de código, no es fácil de comprenderlas, tampoco hay recetas mágicas. Yo ordenaría como si fuesen cajas, una entrada, un proceso
2019 Sep 24
2
Consulta
Emilio Ahora cuando quiero instalar los paquetes pdftools, magick y otros más me salen el siguiente error WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ?C:/Users/bdominguez/Documents/R/win-library/3.6? (as ?lib?
2012 Jun 05
1
Trouble with Functions
Hi guys, I'm a new to R and following along with Tutorials using this book: http://www.amazon.com/Practical-Statistical-Analysis-Non-structured-Applications/dp/012386979X In one of them, they use the twitteR package and describe the following function (see below). From what I can tell from the documentation (R), there's a method to call it directly in an interactive session. The way
2019 Sep 23
5
Consulta
Buenas tarde a todo en s: Tenia la versión de R 3.6 y utilizaba la paquetería de pdftools para extraer información de archivos en pdf actualice la versión 3.6.1 y ya no reconoce la paquetería alguien que me pueda ayudar. Prácticamente no reconoce las funciones de pdftools library(pdftools) library(stringr)? library(NLP)? library(tm)? library(tesseract)? library(magick)?
2023 Dec 18
3
Function with large nested list
Hello list, I want to make a large rulebased algorithm, to provide decision support for drug prescriptions. I have defined the algorithm in a function, with a for loop and many if statements. The structure should be as follows: 1. Iterate over a list of drug names. For each drug: 2. Get some drug related data (external dataset). Row of a dataframe. 3. Check if adaptions should be made to
2012 Jun 27
2
A solution for question about formatting Dates
Hello again: Here is a solution to the dates without leading zeros: pou1 <- function(x) { #Note: x is a data frame #Assume that Column 1 has the date #Column 2 has station #Column 3 has min #Column 4 has max library(stringr) w <- character(length=nrow(x)) z <- str_split(x[,1],"/") for(i in 1:nrow(x)) { u <-
2013 Apr 16
1
converting blank cells to NAs
You can use na.strings="" in read.table() or read.csv() library(stringr) vec1<-unlist(str_split(readLines(textConnection("3,7,11,,12,14,15,,17,18,19")),",")) ?vec1[vec1==""]<- NA ?vec1 # [1] "3"? "7"? "11" NA?? "12" "14" "15" NA?? "17" "18" "19" #or
2013 Apr 22
1
Print occurrence / positions of words
Hi, May be this helps: vec<- "this is a nice text with nice characters" library(stringr) ?vec2<-unlist(str_match_all(vec,"\\w+")) #or # vec2<-str_split(vec," ")[[1]] res<-unique(lapply(vec2,function(x) which(!is.na(match(vec2,x))))) ?names(res)<- unique(vec2) res #$this #[1] 1 # #$is #[1] 2 # #$a #[1] 3 # #$nice #[1] 4 7 # #$text #[1] 5 # #$with #[1]
2017 Aug 30
1
Dataframe Manipulation
by using these two tables we have to create third table in this format where categories will be on the top and transaction will be in the rows, On 30 August 2017 at 16:42, Hemant Sain <hemantsain55 at gmail.com> wrote: > Hello Ulrik, > Can you please once check this code again on the following data set > because it doesn't giving same output to me due to absence of quantity,a
2018 Mar 22
1
Calculate weighted proportions for several factors at once
Hi, I have a grouped data set and would like to calculate weighted proportions for a large number of factor variables within each group member. Rather than using dplyr::count() on each of these factors individually, the idea would be to do it for all factors at once. Does anyone know how this would work? Here is a reproducible example: ############################################################
2017 Nov 03
4
Problemas con función factor to integer
Hola, estoy teniendo problemas para conseguir que mi función haga lo que quiero. Necesito que coja los valores de la variable que le indico, le quite la letra que precede a dichos valores y los convierta en números enteros. Dejo un ejemplo de los datos que estoy tratando y de varias opciones de función con las que intento que funcione sin resultado. #Ejemplo >
2018 Mar 09
2
Imputar NA a SQL Server
No , lo mete como string... Obtener Outlook para Android<https://aka.ms/ghei36> ________________________________ From: Javier Marcuzzi <javier.ruben.marcuzzi en gmail.com> Sent: Friday, March 9, 2018 3:47:46 AM To: Jes?s Para Fern?ndez Cc: Lista R Subject: Re: [R-es] Imputar NA a SQL Server Estimado Jes?s Para Fern?ndez Pruebe lo siguiente: str_replace_all(values,
2013 Apr 18
0
Splitting vector
Hi, Try: vec1<- "mue#d/sjbijk at ruepvnvbnceiicrpgxkgcyl@keduhqvqi/ubudvxopddpfddgitrynzshzdcwgneyffrkpbxwilwqngrsals#geqmtkcpkp/qecgdfa#uag" library(seqinr) ?res<-lapply(0:4,function(i) lapply(2:5,function(j) splitseq(s2c(gsub("[#@/]","",vec1)),word=j,frame=i))) #or library(stringr) res1<-lapply(0:4,function(i) lapply(2:5,function(j)