Re: [R-es] Latex y gráfico

2016-05-12 Thread Freddy Omar López Quintero
​Hola.​ 2016-05-13 0:22 GMT-03:00 Javier Marcuzzi : > Probé de su sugerencia el ejemplo 3.4, pero me falla, copio y pego todo el > código junto al error > > > > > library(tikzDevice) tikz( > ​​ > ’figs/simpleEx.tex’,width=3.5,height=3.5) plot(1,main=’Hello

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-12 Thread John Dougherty
On Thu, 12 May 2016 13:19:54 -0400 "yoursurrogate...@gmail.com" wrote: > Hello, I can't post my code since it's on a work computer. > > But basically, I have a dataframe that has two columns, one is a > string and the other is an integer. I want to turn this into a

Re: [R-es] Latex y gráfico

2016-05-12 Thread Javier Marcuzzi
Estimado Freddy Omar López Quintero Muchas gracias. Probé de su sugerencia el ejemplo 3.4, pero me falla, copio y pego todo el código junto al error > library(tikzDevice) tikz(’figs/simpleEx.tex’,width=3.5,height=3.5) > plot(1,main=’Hello World!’) dev.off() Error: unexpected symbol in

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Alba Pompeo
Martin Morgan, I tried an HTTP mirror and it worked. What could be the problem and how to fix? Also, should I ignore the warning about ignoring environment value of R_HOME? Thanks. On Thu, May 12, 2016 at 5:59 PM, Tom Hopper wrote: > setInternet2() first thing after

Re: [R-es] Division entre el numero de ocurrencias parciales y totalesdentro de un DataFrame de manera eficiente

2016-05-12 Thread Javier Marcuzzi
Estimado Tomi Massó Jou Pienso en dos partes, la primera, para ser optimizado debería trabajar con vectores. En todo caso con for, if. Lo segundo que pienso, usted dice que va a tener muchos datos, ¿Qué pasa si en lugar de data.frame intenta con data.table? Javier Rubén Marcuzzi De: Toni

[R-es] Division entre el numero de ocurrencias parciales y totales dentro de un DataFrame de manera eficiente

2016-05-12 Thread Toni Massó Jou
Hola: A ver si me podéis ayudar que estoy atascado... Necesito contar los subcasos de la columna 2 de un dataframe respecto a los casos de la columna 1. Es decir, tengo un data.frame a<-c(rep(c('a','b','c','b','c'),3),'b') b<-c(rep(c('x','y','z','w'),4)) c<-c(rep(c(1,1,0,0),4))

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Tom Hopper
setInternet2() first thing after launching R might fix that. > On May 12, 2016, at 07:45, Alba Pompeo wrote: > > Hello. > > I've tried to run R, but I receive many warnings and can't do simple > stuff such as installing packages. > > Here's the full log when I run it. >

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-12 Thread yoursurrogate...@gmail.com
Ok, the horizontal names work here. Thanks. > On May 12, 2016, at 1:31 PM, William Dunlap wrote: > > Does this do what you want? > > z <- data.frame(Name=c("One","Three","Twelve","Eleven"), Count=c(1,3,12,11)) > with(z, barplot(Count, names=Name, horiz=TRUE)) > with(z,

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-12 Thread Jeff Newmiller
You are missing a reproducible example. We don't care what is on your home or work computer... we just need to have clear communication, so make up some data that shows the problem and some code to go with it. You MIGHT have to show some data that does not have the problem in order to

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-12 Thread William Dunlap via R-help
Does this do what you want? z <- data.frame(Name=c("One","Three","Twelve","Eleven"), Count=c(1,3,12,11)) with(z, barplot(Count, names=Name, horiz=TRUE)) with(z, barplot(Count, names=Name, horiz=TRUE, las=1)) Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, May 12, 2016 at 10:19 AM,

[R] What is the easiest way to turn a dataframe into a barplot?

2016-05-12 Thread yoursurrogate...@gmail.com
Hello, I can't post my code since it's on a work computer. But basically, I have a dataframe that has two columns, one is a string and the other is an integer. I want to turn this into a vertival barplot where on the x-axis I have the string in the first columb and then the plot will display

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Martin Morgan
On 05/12/2016 07:45 AM, Alba Pompeo wrote: Hello. I've tried to run R, but I receive many warnings and can't do simple stuff such as installing packages. Here's the full log when I run it. http://pastebin.com/raw/2BkNpTte Does anyone know what could be wrong here? do you have any success

Re: [R] Bootstrap Methods for Confidence Intervals -- glmnet

2016-05-12 Thread Bert Gunter
Lorenzo: This is a complicated and subtle question that I believe is mostly about statistical methodology, not R. I would suggest that you post your query to stats.stackexchange.com rather than here in order to determine *what* you should do. Then, if necessary, you can come back here to ask

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Jeff Newmiller
Looks to me like something outside of R is blocking network access by R. That could be anything from you don't have networking setup to some security policy or firewall configuration. I doubt this will be the right place to resolve those issues. -- Sent from my phone. Please excuse my

[R] Bootstrap Methods for Confidence Intervals -- glmnet

2016-05-12 Thread Lorenzo Isella
Dear All, Please have a look at the code at the end of the email. It is just an example of regression based on glmnet with some artificial data. My question is how I can evaluate the uncertainty of the prediction yhat. It looks like there are some reasons for not providing a standard error

[R] Warning when running R - can't install packages either

2016-05-12 Thread Alba Pompeo
Hello. I've tried to run R, but I receive many warnings and can't do simple stuff such as installing packages. Here's the full log when I run it. http://pastebin.com/raw/2BkNpTte Does anyone know what could be wrong here? Thanks a lot. __

Re: [R] building a spatial matrix

2016-05-12 Thread Sarah Goslee
I don't see any reason why a loop is out of the question, and answering would have been much easier if you'd included the requested reproducible data, but what about this? This solution is robust to pairs from idcell being absent in censDist, and to the difference from A to B being different than

Re: [R-es] Aplicar una función repetidamente

2016-05-12 Thread Carlos J. Gil Bellosta
g <- function(f, x, k){ for(i in 1:k) x <- f(x) x } g(sqrt, 256, 3) Un saludo, Carlos J. Gil Bellosta http://www.datanalytics.com El 12 de mayo de 2016, 10:40, rubenfcasal escribió: > Yo de primeras lo haría así: > > f <- function(x) return(x^2) > > recursiva

[R] building a spatial matrix

2016-05-12 Thread A M Lavezzi
Hello, I have a sample of 1327 locations, each one idetified by an id and a numerical code. I need to build a spatial matrix, say, M, i.e. a 1327x1327 matrix collecting distances among the locations. M(i,i) should be 0, M(i,j) should contain the distance among location i and j I shoud use

[R] Antwort: Antwort: Re: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-12 Thread G . Maubach
Hi Martin, many thanks for following-up on my question. I did it again: ## capture all the output to a file. zz <- file("C:/Temp/all.Rout", open = "wt") sink(zz) sink(zz, type = "message") try(log("a")) ## back to the console sink(type = "message") sink() close(zz) This works. I tried several

[R] Antwort: Re: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-12 Thread Martin Maechler
> Hi Sarah, > yes, I followed your suggestion. I doubt that you followed it correctly. Sarah's advise is usually really very sound -- and your code below is *not* : > If I do exactly what is in the example of the documentation: > sink("C:/Temp/sink-examp.txt") > i <- 1:10 > outer(i, i, "*") >

Re: [R] break string at specified possitions

2016-05-12 Thread Martin Maechler
> On 5/11/2016 2:23 PM, Jan Kacaba wrote: > > Here is my attempt at function which computes margins from positions. > > > > require("stringr") > > require("dplyr") > > > > ends<-seq(10,100,8) # end margins > > test_string<-"Lorem ipsum dolor sit amet, consectetuer adipiscing > > elit. Aliquam in

Re: [R-es] Aplicar una función repetidamente

2016-05-12 Thread Carlos Ortega
Hola Jorge, Creo que la función que buscas está del lado de las varias implementaciones que tiene "R" del lado de la "Programación Funcional". En particular miraría la función "Reduce()". Y también la función "accumulate()" del paquete de Hadley Wickham "purr" (Functional Programming Tools).

Re: [R] break string at specified possitions

2016-05-12 Thread Jan Kacaba
Nice solution Jim, thank you. 2016-05-12 2:45 GMT+02:00 Jim Lemon : > Hi again, > Sorry, that should be: > > chop_string<-function(x,ends) { > starts<-c(1,ends[-length(ends)]+1) > return(substring(x,starts,ends)) > } > > Jim > > On Thu, May 12, 2016 at 10:05 AM, Jim

[R] Antwort: Re: Antwort: Re: Antwort: Re: Re: sink(): Cannot open file (SOLVED)

2016-05-12 Thread G . Maubach
Hi Henrik, Jim, Sarah, Duncan, Hi All, I have tried the built-in solution using PowerShell: $lockedFile="C:\Windows\System32\wshtcpip.dll" Get-Process | foreach{$processVar = $_;$_.Modules | foreach{if($_.FileName -eq $lockedFile){$processVar.Name + " PID:" + $processVar.id}}} It did not show

Re: [R] how to manipulate ... in the argument list

2016-05-12 Thread Witold E Wolski
Duncan suggested to use the argument explicitly and combine it with the missing function which is for this problem also my preferred solution: image.2 <- function(x, col , breaks, ...){ # function is manipulating colors (adding a few) # since it changes colors it needs to update breaks if