Re: [R] table

2015-03-03 Thread Jim Lemon
Hi maicel, This may be completely off the mark, but the brkdnNest function in the plotrix package can produce a nested list of counts which can be transformed into percents (100*count/total). require(plotrix) data$dummy<-1 brkdnNest(dummy~Provincial+Municipios+unit,data,FUN="sum") The counts in y

Re: [R] How to speed up a double loop?

2015-03-03 Thread Jeff Newmiller
Usually there is some trick with diff or role or cumsum that can make something like this work, but all I can come up with is using Rcpp to brute force it. That works best if you create a package, but it can work okay without it if this is a one-off analysis. Note that demolishing data as in yo

Re: [R] table

2015-03-03 Thread Jeff Newmiller
I suspect that the tabular function in the tables package would handle this task. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] check a list that a sublist exists

2015-03-03 Thread Alaios via R-help
Hi all,I have a list that has the following fields. $`80` [1] "Error in if (fitcass1[[2]] == \"Error\") { : \n  Fehlender Wert, wo TRUE/FALSE nötig ist\n" attr(,"class") [1] "try-error" attr(,"condition") $`81` [1] 0 $`9` [1] 0 $`79` $parameters     pi   mu    sigma 1 0.999679

Re: [R] check a list that a sublist exists

2015-03-03 Thread Gerrit Eichner
Hello, Alaios, try is.null( Mylist[[i]]$parameters) It returns TRUE if your list doesn't have a component named "parameters" or if that component contains NULL. HtH -- Gerrit On Tue, 3 Mar 2015, Alaios via R-help wrote: Hi all,I have a list that has the following fields. $`80` [1] "Er

Re: [R] table

2015-03-03 Thread Jim Lemon
Hi Jeff, I don't have that package, but reading the documentation, I think you are right. Plus the tabular function already has the formatting worked out. Jim On Tue, Mar 3, 2015 at 7:26 PM, Jeff Newmiller wrote: > I suspect that the tabular function in the tables package would handle > this t

Re: [R] How to speed up a double loop?

2015-03-03 Thread PIKAL Petr
Hi Removal outliers is quite tricky business and especially automatic removal of outliers. I have in some cases different approach. If I know that some series is stationary and there are some dropouts in measurement (somebody disconnected it, process stopped for whatever reasons) I take large

Re: [R] vectorize data string analysis

2015-03-03 Thread John McKown
Have you looked at readChar() ? You can use it to read your input file in undelimited chunks of 220 bytes, and at the same time, parse into variable. Look at the example in the help ?readChar. Unfortunately I can't really see exactly how the columns break, but I have your data in a file: x.data in

Re: [R] R crashes when I run rgeos::gDistance

2015-03-03 Thread Roger Bivand
Adrian Torchiana gmail.com> writes: > > Hi, > > This is my first post to R-help. I'm having trouble getting rgeos to work. R-help is arguably too general to help, please ask questions of this kind on R-sig-geo. > > Info on the server and packages I'm using: > ... > $ *rpm -qa | grep geos*

[R] Reglamento IMSS Construcción y SATIC’s. 11 marzo2015

2015-03-03 Thread Pilar Serrano
�HARTO DE COBROS ESTIMATIVOS DE CUOTAS POR PARTE DEL IMSS AL FINALIZAR CADA OBRA DE CONSTRUCCI�N? Asista al Curso: APLICACI�N PR�CTICA DEL REGLAMENTO DEL SEGURO SOCIAL PARA CONSTRUCTORAS Y SUBCONTRATISTAS Y LOS FORMATOS SATIC ��Qu� hacer ante los constantes cobros estimativos de cuota

[R] Frontier efficient using black litterman model In R

2015-03-03 Thread mukesh surywanshi
Hi I'm working on getting frontier efficient plot using Black Litterman model. I have used Blcop package and its function optimalPortfolio.optim() using this i have got optimal risk and return with weights If i want to get 10 portfolio risk and return with corresponding weights,,, how to do it>

[R] Rcpp module / class access

2015-03-03 Thread Pascal A. Niklaus
Dear all, I am struggling accessing a class created in an Rcpp module. The structure of the package is essentially the one created using: Rcpp.package.skeleton(name="testPackage",module=TRUE) Now, after loadiong the package with library(testPackage), I can create instances of the "World" cla

Re: [R] How to speed up a double loop?

2015-03-03 Thread jeff6868
I tried another faster way which seems to do the trick right now: myts <-data.frame(x=c(10,2,50,40,NA,NA,0,50,1,2,0,0,NA,50,0,15,3,5,4,20,0,0,25,22,0,1,100),z=NA) test <- function(x){ st1 <- numeric(length(x)) temp <- st1[1] for (i in 2:(length(x))){ if((!is.na(

Re: [R] readHTMLTable() in XML package

2015-03-03 Thread Doran, Harold
Hadley Thanks. I ran into the same roadblock when I use your code below by increasing i to loop over all pages. I think the problem is related to the fact that the website I'm scraping is getting hammered with users and the error is just related to a timeout. I have provisionally solved my pro

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-03 Thread Sun Shine
Hi again I've now had the chance to try this out, and using scan() doesn't seem to work either. This is what I used: 1) I generated a plain text file called stopDict.txt. This file is of the format: "a, bunch, of, words, to, use" 2) I invoked scan(), like this: > userStopList <- scan(text

[R] 2D Timeseries trace plot

2015-03-03 Thread AjayT
Hi, I've got a 2D timeseries of handwriting samples, xy time 1 1073 1058 769.05 2 1072 1085 769.07 3 1066 1117 769.08 4 1052 1152 769.10 5 1030 1196 769.12 6 1009 1242 769.13 7 994 1286 769.14 upto 500 I was just wondering how to plot this as an animation, so that the point

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-03 Thread Jeff Newmiller
You seem to be conflating the data input operation with your data processing. You need to stop and examine the in-memory representation of your data {"userStopList"), and compare it with the expectations of your data processing operation ("tm_map"). Then adjust your input data by choosing a diff

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-03 Thread Jim Holtman
Send me a copy of your file so I can see what it looks like and what the output should be. Sent from my Verizon Wireless 4G LTE Smartphone Original message From: Sun Shine Date:03/03/2015 09:43 (GMT-05:00) To: jim holtman Cc: r-help Subject: Re: [R] Using a text file as

Re: [R] 2D Timeseries trace plot

2015-03-03 Thread David L Carlson
You can do this with the animation package. Install the package and then # Load the package library(animation) # This representation makes your data more portable using the dput() function: pen <- structure(list(x = c(1073L, 1072L, 1066L, 1052L, 1030L, 1009L, 994L), y = c(1058L, 1085L, 1117L,

[R] Sorting list elements according to their mean value

2015-03-03 Thread mtb954
Hello R-helpers, I have a list of 999 dataframes and I would like to sort the list by the mean value of one of the columns in the data frames. Here is a small, self-contained example: #begin example iterations<-999 d<-list() #resampled data f<-list() #fitted values r<-list() #residuals l<-

Re: [R] Sorting list elements according to their mean value

2015-03-03 Thread William Dunlap
Use order(), as in sortListByMean <- function(List) { List[order(vapply(List, mean, 0))] } sortedL <- sortListByMean(l) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Mar 3, 2015 at 11:01 AM, wrote: > Hello R-helpers, > > I have a list of 999 dataframes and I would like to s

[R] help with plotting error bars on xyplot!

2015-03-03 Thread Paulo Pagliari
Dear R helpers, I am trying to create a xyplot similar to this one: https://stat.ethz.ch/pipermail/r-help/2008-June/164968.html I can plot the data correctly when I only have one Y. However, I need to add another Y (Y2) to the plot and each Y must have their own error bars and also different s

[R] Rcpp module / class access -- answer

2015-03-03 Thread Pascal A. Niklaus
Hi all, I am trying to answer my own question (although it probably does not end up in the thread because I am not a subscribed and thus have to send a new mail). The way I finally got the code working was: In NAMESPACE, comment out the following lines # importFrom(Rcpp, loadModule) # imp

[R] Mining non-english text

2015-03-03 Thread saikiran putta
I am new to R programming and trying to mine this pdf file http://164.100.180.82/Rollpdf/AC276/S24A276P001.pdf. This pdf file is in non-English language and I'm not able to figure out how to proceed. And, I'm not even sure how to extract information from a PDF file, so please help! [[alter

[R] bigglm connected to a database

2015-03-03 Thread Glenn Schultz
I can get bigglm working with the following code. ModelFit <- bigglm(SMM ~                      I(1-.88 * exp(-.192 * LoanAge))+                      ns(Incentive, df = 5)+                      Purpose +                     Occupancy +                     TPO +                     Servicer,      

[R] sampling dataframe based upon number of record occurrences

2015-03-03 Thread Curtis Burkhalter
Hello everyone, I'm having trouble performing a task that is probably very simple, but can't seem to figure out how to get my code to work. What I want to do is use the sample function to pick records within in a dataframe, but only if a column attribute value is repeated more than 3 times. So if

[R] devtools: install_git hangs on Windows

2015-03-03 Thread Luca Cerone
Hi, I am trying to setup R on a Windows 7 64b machine, but despite I have followed the instructions for Windows (installing Rtools, building the package etc), whenever I try to use install_git and install_url, RStudio (and R) hangs. I have identified the issues being with: system("git clone ..

Re: [R] bigglm connected to a database

2015-03-03 Thread Greg Snow
It may be simpler to specify the order in the contrasts rather than trying to order the data. See the C function (notice capitol C). I have never tried this with the bigglm function, so I don't know if it will work the same way or not. But if it works, then that may be a simpler approach. On Tu