Luca Cerone | 3 Mar 22:30 2015
Picon

devtools: install_git hangs on Windows

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 .......")
It creates a local repository, but then the download hangs.
(the same issues apply if I use shell or system2)

git works fine in both the cmd and git-bash shells, but whenever git
clone is called from within R, the command hangs while downloading.

Does any of you have the same issue? Has any of you been able to solve it?

Thanks in advance for the help,

Best wishes,
Luca

Curtis Burkhalter | 3 Mar 22:22 2015
Picon

sampling dataframe based upon number of record occurrences

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 you look at
the data below I have created a unique attribute value that corresponds to
every site by year combination (i.e. IDxYear). So you can see that for the
site called "A-Airport" it was sampled 6 times in 2006, "A-Bank Corral
East" was sampled twice in 2008. So what I want to do is randomly select 3
records for "A-Airport" in 2006 for the existing 6 records, but for "A-Bark
Corral East" in 2008 I just want to leave these records as they currently
are.

I've used the following code to try and  accomplish this, but like I said I
can't get it to work so I'm clearly doing something wrong. If you could
check out the code and provide any suggestions that would be great. It
should be noted that there are 5589 unique IDxYear combinations so that's
why that number is in the code. If any further clarification is needed also
let me know.

boom=data.frame()
for (i in 1:5589){

boom[i,]=ifelse(length(fitting_set$IDbyYear[i]>3),fitting_set[sample(nrow(fitting_set),3),],fitting_set)

}
boom

              *IDbyYear*           *SiteID *                  *Year*
(Continue reading)

Glenn Schultz | 3 Mar 21:02 2015

bigglm connected to a database

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,
                    data = sqlQuery(Train.Data, ModelData),
                    family = binomial(link = "logit"),
                    chuncksize = 10000,
                    maxit = 100)

However, I would like to order the factors so I wrote the following code to make data.  However, it is not
working.  I have read through the manual as well as some examples provided and I am not having much success
with the revised code below.  I think I need to make data and provide ordering of the factors in the make
data but so far this scheme has not worked.  I think I am missing somethin any insights are appreciated.

Best Regards,
Glenn

make.data <- function(connection, query, chunksize,...){
 
    function(reset = FALSE) {
      if (reset) {
        if (got > 0) {
            dbClearResult(result)
            result <<- dbSendQuery(Train.Data, ModelData)
            got <<- 0
(Continue reading)

Pascal A. Niklaus | 3 Mar 16:35 2015
Picon

Rcpp module / class access -- answer

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)
# importFrom(Rcpp, evalCpp)

In zzz.R:

# loadModule("mod_yada",TRUE);

.pkgNamespace <- environment()

.onLoad <- function(libname, pkgname) {
   assign("mod_yada",
   Module("mod_yada",PACKAGE="testPackage",mustStart=TRUE),
   envir=.pkgNamespace);
}

The object generation then works as expected in the S4 class code.

Not sure whether this is the best way to achieve this, though.

Pascal
(Continue reading)

saikiran putta | 3 Mar 18:08 2015
Picon

Mining non-english text

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!

	[[alternative HTML version deleted]]

Paulo Pagliari | 3 Mar 19:07 2015
Picon

help with plotting error bars on xyplot!

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 symbols.  You will see that in this plot symbol changes
based on X and not Y. The symbols should change by Y category, for example in the example below, the symbols
with the errors bars sould be one symbol while the symbols without errors bars should have a different
symbol and also should have error bars. Any help will be much appreciated.

Hr = c(0,1,2,3,4,5,0,1,2,3,4,5)
DRUG = rep(c("D", "P"), each=6)
Y = c(1,2,2,2,2,1,3, 4, 4,4, 4, 3)
Y2 = c(2,3,3,3,3,2,4, 5, 5,5, 5, 4)
data = data.frame(Hr, DRUG, Y, Y2)
data$lower1 = data$Y - .5
data$upper1 = data$Y + .5
data$lower2 = data$Y2 - .5
data$upper2 = data$Y2 + .5

prepanel.ci <- function(x, y, ly, uy, subscripts, ...) {
    x <- as.numeric(x)
    ly <- as.numeric(ly[subscripts])
    uy <- as.numeric(uy[subscripts])
    list(ylim = range(y, uy, ly, finite = TRUE)) }

panel.ci <- function(x, y, ly, uy, subscripts, pch = c(1, 16), ...) {
    x <- as.numeric(x)
(Continue reading)

mtb954 | 3 Mar 20:01 2015
Picon

Sorting list elements according to their mean value

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<-list()

for (i in 1:iterations){

iboot<-sample(1:nrow(cars),replace=TRUE)

bootdata<-cars[iboot,]

d[[i]]<-bootdata

f[[i]]<-fitted(lm(bootdata$dist~bootdata$speed))

r[[i]]<-resid(lm(bootdata$dist~bootdata$speed))
(Continue reading)

AjayT | 3 Mar 15:59 2015

2D Timeseries trace plot

Hi,

I've got a 2D timeseries of handwriting samples, 

      x    y   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 points
join up as they are rendered in time. Basically showing how the person who
generated the data writes. 

The time index is not regular and if possible I'd like to avoid padding the
data with duplicate entries if this is avoidable. For example adding a
duplicate of the first row, for a 'padded' time 769.06.

Thanks alot for your help :)  

--
View this message in context: http://r.789695.n4.nabble.com/2D-Timeseries-trace-plot-tp4704127.html
Sent from the R help mailing list archive at Nabble.com.

(Continue reading)

Pascal A. Niklaus | 3 Mar 11:45 2015
Picon

Rcpp module / class access

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" class as follows:

library(testPackage)
mod_yada<-Rcpp::Module("yada",PACKAGE="testPackage",mustStart=TRUE)
w <- new(mod_yada$World);

So far so good.

However, I fail defining a S4 wrapper class within the same package. As 
part of that, I would like to define a generator function that returns 
an instance of mod_yada$World, as in the code above:

However, "yada$World" is not accessible.

I then tried inserting the following line in the respective R file 
(although I thought this was already taken care by the 
"loadModule("yada", TRUE)" that was places in zzz.R by the skeleton 
generator:

mod_yada<-Rcpp::Module("yada",PACKAGE="testPackage",mustStart=TRUE)

(Continue reading)

Pilar Serrano | 3 Mar 07:01 2015

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

HARTO DE COBROS ESTIMATIVOS DE CUOTAS POR PARTE DEL IMSS AL FINALIZAR CADA OBRA DE CONSTRUCCIN? 

Asista al Curso: 

APLICACIN PRCTICA DEL REGLAMENTO DEL SEGURO SOCIAL PARA CONSTRUCTORAS Y SUBCONTRATISTAS Y LOS
FORMATOS SATIC 

Qu hacer ante los constantes cobros estimativos de cuotas que el Seguro Social pretende por cada obra de construccin?
Cmo manejar adecuadamente los Formatos SATIC.
Qu hacer con subcontratistas y maestros de obra.
Cul es el mejor procedimiento a seguir a la terminacin de cada obra.
Y muchos otros temas adicionales.

 

Mircoles 11 de Marzo del 2015, de 09:00 a 15:00 horas. 

MAYOR INFORMACIN E INSCRIPCIONES:
Pilar Serrano
Tel. 2871.2174 y 5364.2319 

Snchez Arellano Abogados.
Divisin Capacitacin.
Quertaro No. 226, Desp. 4-B.
Col. Roma. Deleg. Cuauhtmoc.
06700 Mxico, D.F. 

Consulte ms detalles de ste y otros eventos en:
www sanchezarellanocapacitacion . com 

(Continue reading)

mukesh surywanshi | 3 Mar 07:34 2015
Picon

Frontier efficient using black litterman model In R

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>?
 can anyone help me....

my code goes like this
posterior <- posteriorEst(views, tau = 0.025, meanret, covar)

cons <- c("minW[1:numtk] = rep(0, times = numtk)", "maxW[1:numtk] =
rep(0.50, times = numtk)","minsumW[1:numtk] = 0","maxsumW[1:numtk] = 1")
#"listF = list(lowerExtension, upperExtension)")

res1<-optimalPortfolios.fPort(posterior,
spec=portfolioSpec(),constraints=cons,optimizer =
"minriskPortfolio",numSimulations  = 10)

Thanks
MUKESH

	[[alternative HTML version deleted]]

(Continue reading)


Gmane