similar to: Memory usage in R grows considerably while calculating word frequencies

Displaying 20 results from an estimated 2000 matches similar to: "Memory usage in R grows considerably while calculating word frequencies"

2013 Sep 30
1
str_count counts the substring
I am trying to count the number of times a word occurs in a string. and using str_count function from the package stringr. This function counts the substrings as well. Is there a way in which I can exclude the substring count and just take the exact match. Thanks in advance. -- Thanks and Regards Agrima Srivastava -------------------------------------------------------------------------------
2014 Jul 22
2
Ayuda Error in `colnames<-`(`*tmp*`, value = c(
Buenas tardes, grupo. Estoy tratando de hacer la comparación de dos archivos de una misma organización para encontrar las diferencias entre su informe del tema edl año 2005 y el del año 2013: Todos los comandos van bien, a exepción del último "colnames", como se ve en la siguiente secuencia: > pdf1<-"./PLAN de INSPECCIONES/05_seguridad_ciudadana.pdf" >
2019 Aug 15
4
Feature request: non-dropping regmatches/strextract
A very common use case for regmatches is to extract regex matches into a new column in a data.frame (or data.table, etc.) or otherwise use the extracted strings alongside the input. However, the default behavior is to drop empty matches, which results in mismatches in column length if reassignment is done without subsetting. For consistency with other R functions and compatibility with this use
2012 Nov 02
2
backreferences in gregexpr
Hi Folks, I'm trying to extract just the backreferences from a regex. > temp = "abcd1234abcd1234" > regmatches(temp, gregexpr("(?:abcd)(1234)", temp)) [[1]] [1] "abcd1234" "abcd1234" What I would like is: [1] "1234" "1234" Note: I know I can just match 1234 here, but the actual example is complicated enough that I have to
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
2019 Sep 02
2
Feature request: non-dropping regmatches/strextract
I think that's a good reason for not including this in regmatches; you're right, its name is somewhat suggestive of yielding matches. Also, that sounds like a great design for strcapture with an atomic prototype. Best, CG
2019 Aug 15
1
Feature request: non-dropping regmatches/strextract
Using a non-capturing group, "(?:...)" instead of "(...)", simplifies my example a bit > x <- c("Groucho <groucho at marx.com>", "<chico at marx.com>", "Harpo") > strcapture("([[:alpha:]]+)?(?: *<([[:alpha:]. ]+@[[:alpha:]. ]+)>)?", x, proto=data.frame(Name=character(), Address=character(),
2019 Aug 15
2
Feature request: non-dropping regmatches/strextract
I do think keeping the default behavior is desirable for backwards compatibility; my suggestion is not to change default behavior but to add an optional argument that allows a different behavior. Although this can be implemented in a user-defined function, retaining empty matches facilitates programmatic use, and seems to be something that should be available in base R. It is available, for
2013 Feb 18
3
Cortar una cadena por un caracter solo cuando no forma parte de una subcadena entrecomillada
Hola, ¿qué tal? Tengo el siguiente problema. Me llegan (simplificando) cadenas del tipo 1,2,"algo"; 3,"cosa"; 4,2,3,7; y tengo que partirlas por el caracter ";" para meterlas en una lista. Lo hago con strsplit y no tengo problemas... ... hasta que recibo cadenas como 1,2,"algo;todo"; 3,"cosa"; 4,2,3,7; en las que existen puntos y coma
2012 Jun 13
2
need help
hello could you help in solving the following problem I want to replace same consecutive words by a single word in a sentence.. for example --- my name name name is micky so I want the output like this--my name is micky I want this solution for a text file can you tell me the code for it?? thanking you in anticipation -- Shilpa Rai MSc.(2011-2013) Applied Statistics and Informatics Indian
2012 Aug 30
2
Help on Plot Title where text is "mixed" with numerical carachters
Dear All,   I have the following code set up:   x <-2000 y <-8 z <-3   I would need to use these numbers to show up in my plot title "mixed" with text. The x,y,z numbers would need to change, the text would not. So my title should look like this   "x txt1 y txt2 z txt3"   so if: txt1=hours txt2=minutes txt3=seconds   then my title of the plot should read:   2000 hours
2012 Aug 21
7
Regular Expressions in grep
Dear r-help members, I have a number in the form of a string, say: a<-"-01020.909200" I'd like to extract "1020." as well as ".9092" Front<-grep(pattern="[1-9]+[0-9]*\\.", value=TRUE, x=a, fixed=FALSE) End<-grep(pattern="\\.[0-9]*[1-9]+", value=TRUE, x=a, fixed=FALSE) However, both strings give "-01020.909200", exactly
2010 Feb 14
2
unable to edit a file
hi, I have a file in a samba share with the following attributes: [dir1002] comment = webmin share write list = usr1,usr2 path = /misc/removable/dir1002 read only = no The files are created with the following ownership(the file system is vfat): -rwxr-xr-x 1 root root 0 Feb 14 07:23 New Text Document.txt -rwxr-xr-x 1 root root 4 Feb 14 07:28 txt1.txt
2005 Feb 21
1
is.matrix(), as.matrix, & as(,"matrix")
Under help(matrix) it is written: 'is.matrix' tests if its argument is a (strict) matrix. It is generic: you can write methods to handle specific classes of objects, see InternalMethods. Further down, under "Details", the meaning of "strict" is explained more explicitly: 'is.matrix' returns 'TRUE' if 'x' is a matrix
2005 Jul 06
3
plotting on a reverse log scale
I'd like to do some plots of historical event data on a reverse log scale, started, say at the year 2000 and going backwards in time, with tick marks spaced according to log(2000-year). For example, see: http://euclid.psych.yorku.ca/SCS/Gallery/images/log-timeline.gif As an example, I'd like to create a density plot of such data with the horizontal axis reverse-logged, a
2008 Aug 01
1
Properly Parsing Pre-Superscripts & Displaying Them With grid.text
Hi all... I?m making a chart dealing with frequencies of isotopes of various elements. For instance, I'd like the following text to appear on a chart with the "35" and "37" as superscripts: Based upon: 35Cl: 75% 37Cl: 25% I am having problems properly parsing the superscript that preceeds the "Cl", since there is no character ahead of the superscript (I saw
2006 Jan 10
2
Problem with Action:Originate with ASterisk Manager
Hi Asterisk-users, I am working with Aterisk Manager API's. I can login successfuly with the following. char buff[256]; strcpy(buff, "Action: Login\r\nUsername: admin\r\nSecret: unix\r\n\r\n"); send(msock, buff, 255); Now I want to try Action: Originate, therefore I tried the following char buff1[256]; strcpy(buff1, "Action: Originate\r\nChannel:
2002 Dec 11
3
Excluding levels in table and xtabs
I'm trying to form contingincy tables among a set of character variables which were read from a .csv file and have missing represented as "". I want to exclude the missing levels from the table. > levels(CPIC) [1] "" "N" "Y" > levels(Manix) [1] "" "N" "Y" > xtabs(~CPIC + Manix, exclude=c("",NA))
2015 Nov 23
1
capturing warnings using capture.output
>From the Details section of ?capture.output: Messages sent to stderr() (including those from message, warning and stop) are captured by type = "message". Note that this can be "unsafe" and should only be used with care. Capturing messages works as expected: capture.output(message("!!!"), type = "message") ## [1] "!!!" Capturing warnings
2012 Dec 12
2
how to grep in r
Hi, I met this problem. Trade_Price_Band x 1 0-30 0.6237240 2 101-150 0.6743857 3 151-200 0.6778513 4 201-300 0.6640293 5 301-400 0.6630991 6 31-50 0.6314547 7 401-500 0.6776249 8 500+ 0.6557705 9 51-75 0.6621073 10 76-100 0.6623469 I want to get the following matrix