similar to: Multiple String word replacements: Performance Issue

Displaying 20 results from an estimated 9000 matches similar to: "Multiple String word replacements: Performance Issue"

2006 Mar 14
2
Multi-line paste function
Here's my contribution to R. When R interacts with external programs (MySQL, cURL, etc.), it often requires a pasted string that is sent to these programs. For readability reasons, it is often preferable to have complex commands (SQL for example) spread on several lines. However, the normal paste function requires to add additional ' ", ' at the end of each line and another '
2010 Jan 20
7
Data Manipulation
Dear All, I would like to to group the Ticker by Industry and create file names from the Industry Factor and export to a txt file. I have tried the folowing ind=finvizAllexETF$Industry ind is then "Aluminum" "Business Services" "Regional Airlines" ind2=gsub(" " ,"",ind) ind3 [1] "Aluminum"
2016 Apr 18
2
Sum of Numeric Values in a DF Column
... and here is a non-dplyr rsolution: > z <-gsub("[^[:digit:]]"," ",dd$Lower) > sapply(strsplit(z," +"),function(x)sum(as.numeric(x),na.rm=TRUE)) [1] 105 67 60 100 80 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom
2016 Apr 18
0
Sum of Numeric Values in a DF Column
... and a slightly more efficient non-dplyr 1-liner: > sapply(strsplit(dd$Lower,"[^[:digit:]]"), function(x)sum(as.numeric(x), na.rm=TRUE)) [1] 105 67 60 100 80 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On
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)?
2016 Apr 18
0
Sum of Numeric Values in a DF Column
## Continuing with your data AA <- stringr::str_extract_all(dd[[2]],"[[:digit:]]+") BB <- lapply(AA, as.numeric) ## I think you are looking for one of the following two expressions sum(unlist(BB)) sapply(BB, sum) On Mon, Apr 18, 2016 at 12:48 PM, Burhan ul haq <ulhaqz at gmail.com> wrote: > Hi, > > I request help with the following: > > INPUT: A data frame
2016 Apr 18
3
Sum of Numeric Values in a DF Column
Hi, I request help with the following: INPUT: A data frame where column "Lower" is a character containing numeric values (different count or occurrences of numeric values in each row, mostly 2) > dput(dd) structure(list(State = c("Alabama", "Alaska", "Arizona", "Arkansas", "California"), Lower = c("R 72?33",
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 May 08
1
Extracting Hash-tagged word from Tweets
Can someone help me with the code I can use to extract word preceded by hash tag in live tweets download from twitteR. An example of what I require is: [[9]] [1] "HollandUKTrade: #Dutch companies striking Olympic gold at London 2012 http://t.co/XsvvXAzT #london2012 #olympics #sport @hollandtrade @dutchembassyUK" (Tweet download) I want a code that will extract this: #Dutch companies
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2010 Mar 31
3
regular expression help to extract specific strings from text
Dear all, Lets say I have the following: > x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at statistics that #Excel ever was! @Cain & @Able disagree though :(", "Adam: @Eve I'm sure they'll sort it out :)", "blahblah") > x [1]
2007 Mar 07
1
Read data with different column lengths
Dear r-help users, I have the following simple problem: Reading data from a file. The file is a .txt file exported ("save as...") from Excel (see below for an example). The Excel file consists of two header rows (first row consists of ticker symbols of stocks, the second row consists of column explanations ("Date","Px Last"), followed by several rows of
2001 Feb 01
1
constructing a vector from a dataframe and another vector
Hi All, I have a dataframe, divs, that looks like this: > divs date ticker dividend 263 20010322 ADBE 0.025 264 20010628 ADBE 0.025 265 20010927 ADBE 0.025 4308 20010212 ED 0.550 4309 20010514 ED 0.410 5416 20010330 GE 0.137 5417 20010629 GE 0.137 5418 20010928
2011 Feb 23
3
Using string to call/manipulate an object
I am using getSymbols function from quantmod package to get price data from internet. Currently I have: my.ticker <- "IBM" getSymbols(my.ticker,src="google") This creates an xts object named my.ticker which contains historical price data for IBM. How can I call and manipulating this xts object using my original string my.ticker? I want to do: colnames(my.ticker) <-
2012 Oct 29
2
find the Best-ticker
i need to find the best ticker from the group of some tickers.? i also need to know on what basis we calculate the best ticker? i have some idea about the if the risk rate low, or the market price high we can say the ticker is best. but i dont know is it true. Anyone can help me . Thank you -- View this message in context:
2009 Jun 25
1
apply on xts
Hi, I do not understand why after I called apply on a function that returns an xts (getIdvAdjSeries) it returns a matrix whose columns are just numeric value of time series in xts instead of a list of xts objects. Basically, I called the following: apply(matrix(tickers,ncol=1),1,FUN=getDivAdjSeries) getDivAdjSeries <- function(ticker) { seriesName <-
2001 Oct 03
0
Several R vs S-Plus issues (PR#1110)
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2011 Jan 19
1
Problem in using bdh function for Govt tickers
Hi, all I wanted to fetch data from Bloomberg for govt bonds, and analyse it further. I am having trouble in getting data as when I use field=PX_LAST, it is giving the prices but when I use field=CPN, or ISSUE_DT, it is not giving the results and just bouncing back <NA> for that. This is the piece of code: > library(rJava) Warning message: package 'rJava' was built
2011 Apr 13
1
Assign with Paste Problem
Dear R Helpers, I am trying to change the name of an object using the assign function. When I use paste on the new object but not the old, everything is fine: The new object is a direct copy of the old object. When I use a paste for both the new and the old object, however, the new object is simply the character representation of the old object name, not the old object itself. The example