similar to: keeping output in memory

Displaying 20 results from an estimated 10000 matches similar to: "keeping output in memory"

2011 Aug 14
1
Using get() or similar function to access more than one element in a vector
Dear R-users, I've written a script that produces a frequency table for a group of texts. The table has a total frequency for each word type and individual frequency counts for each of the files. (I have not included the code for creating the column headers.) Below is a sample: Word Total 01.txt 02.txt 03.txt 04.txt 05.txt the 22442 2667 3651 1579 2132 3097 I 18377 3407 454 824 449
2012 Oct 25
2
Minería de texto
Cordial Saludo Actualmente estoy realizando una función para gráficar una nube de palabras el código que tengo es el siguiente: library(twitteR)library(tm)library(wordcloud)library(RXKCD)library(RColorBrewer) tweets=searchTwitter(''@afflorezr'', n=1500) generateCorpus= function(tweets,my.stopwords=c(),min.freq){ #Install the textmining library require(tm) require(wordcloud)
2009 Nov 12
1
How can this code be improved?
I am running the following code on a MacBook Pro 17" Unibody early 2009 with 8GB RAM, OS X 10.5.8, R 2.10.0 Patch from Nov. 2, 2009, in 64-bit mode. freq.stopwords <- numeric(0) freq.nonstopwords <- numeric(0) token.tables <- list(0) i.ss <- c(0) cat("Beginning at ", date(), ".\n") for (i.d in 1:length(tokens)) { tt <- list(0) for (i.s in
2011 Nov 28
3
setting up a "server"
Hi, I have the install guide and the admin guide....nothing in either that I can see from the contents pages tells me how to create the first "server" ( I assume that is what I have to do?) Is there another doc Im missing? or a good URL for a howto on a redhat based machine? Also from what I can see the "free" version is cli only? and there is no virtual (vmware) appliance?
2006 Apr 11
1
error in which(): recursive default argument reference
Dear useRs, I have written a very simple function to compute some probabilities on words (function is below). The function includes a which() statement applied to a vector of characters (word.split): sapply (word.split, function(x) which(letters==x)). This statement worked as expected when used outside the global function : > word <- "hello" > (word.split <-
2012 Dec 13
2
Tamaño de la matriz de términos y memoria. Paquete TM
Hola a todos! Tengo algunos problemas con el tamaño de la matriz de términos que obtengo. Los comandos que utilizo son los siguientes: # carga librerias library(tm) library(wordcloud) library(Rstem) library(Snowball) # lee el documento UTF-8 y lo convierte a ASCII txt <-
2012 Jan 27
2
tm package: handling contractions
I tried making a wordcloud of Obama's State of the Union address using the tm package to process the text sotu <- scan(file="c:/R/data/sotu2012.txt", what="character") sotu <- tolower(sotu) corp <-Corpus(VectorSource(paste(sotu, collapse=" "))) corp <- tm_map(corp, removePunctuation) corp <- tm_map(corp, stemDocument) corp <- tm_map(corp,
2014 Jul 29
2
wordcloud y tabla de palabras [Avanzando]
Buenas tardes grupo. Saludos cordiales Carlos J., muchas gracias por tu orientación. Efectivamente, me había dado cuenta que la razón por la que no se aplicaba colnames era porque no tenía columnas. La cuestión es que no logro visualizar completamente/claramente en qué parte del proceso de creación del corpus se puede hacer. Sin embargo, siguiendo el ejemplo de
2014 Jul 28
2
wordcloud y tabla de palabras
Hola, La referencia (gracias por proporcionarla) que has incluido es bastante clara y se puede seguir. ¿Has podido sobre tus dos discursos utilizar la misma lógica? La forma de salir de dudas, para empezar, es que adjuntaras el código que estás empleando por ver si hay algún error evidente. Aunque la forma adecuada para que te podamos ayudar es con un ejemplo reproducible: código + datos.
2012 Sep 20
3
(no subject)
>From my book on corpus linguistics with R: # (10) Imagine you have two vectors a and b such that a<-c("d", "d", "j", "f", "e", "g", "f", "f", "i", "g") b<-c("a", "g", "d", "f", "g", "a", "f", "a",
2010 Aug 20
4
Regex exercise
For regular expression afficianados, I'd like a cleverer solution to the following problem (my solution works just fine for my needs; I'm just trying to improve my regex skills): Given the string (entered, say, at a readline prompt): "1 2 -5, 3- 6 4 8 5-7 10" ## only integers will be entered parse it to produce the numeric vector: c(1, 2, 3, 4, 5, 3, 4, 5, 6, 8, 5, 6,
2009 Jan 20
1
generalizing expand.table: table -> data.frame
In http://tolstoy.newcastle.edu.au/R/e2/help/06/10/3064.html a method was given for converting a frequency table to an expanded data frame representing each observation as a set of factors. A slightly modified version was later included in the NCStats package, only on http://rforge.net/ (and it has too many dependencies to be useful). I've tried to make it more general, allowing an input
2012 Mar 13
1
size of graphs when using multiple figures by row
Hi all, I have a basic question concerning graphs in R. I?m using the par() function and I?m working with multiple figures by row (mfrow) but my the hight of my figures become compressed. I have 4 rows and 2 columns (because I want to plot 8 histograms (freq = FALSE ) on it. I know I can adapt my margins with for example ?oma? and ?mai? but I don?t know how to choose the size of the figure? I
2007 Sep 21
1
Help create a loopto conduct multiple pairwise operations
#Hello, #I have three data frames, X,Y and Z with two columns each and different numbers of rows. # creation of data frame X X.alleles <- c(1,5,6,7,8) X.Freq <- c(0.35, 0.15, 0.05 , 0.10, 0.35) Loc1 <- cbind( X.alleles,X.Freq) X <- data.frame(Loc1) #creation of data frame Y Y.alleles <- c(1,4,6,8) Y.Freq <- c(0.35, 0.35, 0.10, 0.20 )
2011 Jul 30
3
ifelse returns
Greetings R Community, I am working with the ifelse function and it is returning something unexpected. In the code the line with the MODE1 assignment the output is a vector [1] 4 5 6 but when I put the MODE1 object into the ifelse function [R}'s output for MODE1 is the first number from the string (4). Why is this? Given the supplied vector of x I would assume both the MODE1 and ifelse()
2012 Feb 26
2
tm_map help
Hi all, I am trying to do some text mining with twitter and I am getting the error: Error in structure(names(sapply(possibleCompletions, "[", 1)), names = x) : 'names' attribute [1] must be the same length as the vector [0] When I use tm_map. Has anyone had/seen this error before? The code I have is shown below and this error only occurs with #qantas, hashtags like #asx,
2013 Apr 10
2
Table with n(%) formatting: A better way to do this?
Hello All, Am learning to create tables with n(%) formatting using R. Below is a working example. I think this is not bad but wondered if there are better ways of doing it. Although it can be quite humbling, seeing good code helps me assess my progress as an R programmer. Ultimately want to have code that I can turn into a function. Will then use the output produced to make tables using
2005 Jul 01
2
the format of the result
I write a function to get the frequency and prop of a variable. freq<-function(x,digits=3) {naa<-is.na(x) nas<-sum(naa) if (any(naa)) x<-x[!naa] n<-length(x) ta<-table(x) prop<-prop.table(ta)*100 res<-rbind(ta,prop) rownames(res)<-c("Freq","Prop") cat("Missing value(s) are",nas,".\n") cat("Valid case(s)
2009 Jun 19
1
typo in Lomb-Scargle periodogram implementation in spec.ls() from cts package?
Hello! I tried to contact author of the package, but I got no reply. That is why I write it here. This might be useful for those who were using cts for spectral analysis of non-uniformly spaced data. In file spec.ls.R from cts_1.0-1.tar.gz lines 59-60 are written as pgram[k, i, j] <- 0.5 * ((sum(x[1:length(ti)]* cos(2 * pi * freq.temp[k] * (ti - tao))))^2/sum((cos(2 * pi * freq.temp[k] *
2010 Jun 23
1
Generation of binomial numbers using a loop
Dea'R' helpers I have following data - prob = c(0.1, 0.2, 0.3, 0.4, 0.5) frequency = c(100, 75, 45, 30, 25) no_trials = c(10, 8, 6, 4, 2) freq1 = rbinom(frequency[1], no_trials[1], prob[1]) freq2 = rbinom(frequency[2], no_trials[2], prob[2]) freq3 = rbinom(frequency[3], no_trials[3], prob[3]) freq4 = rbinom(frequency[4], no_trials[4], prob[4]) freq5 = rbinom(frequency[5],