Re: [R] Script/function/procedure with loop

2016-07-11 Thread Luca Meyer
Thanks Sarah, The code works just fine. Luca 2016-07-11 22:43 GMT+02:00 Sarah Goslee : > Taking your question at face value, except for the factors in your > original data frame, you can output anything you'd like to text > onscreen using cat(). Output can also be saved

Re: [R] Is there a way to coerce ggplot into using min & max values for x & y axes?

2016-07-11 Thread Ulrik Stervbo
Hi Ken, You can use coord_cartesian() to set axis. Or if it makes sense to your problem you can facet your plot. Hope this helps Ulrik KMNanus schrieb am Di., 12. Juli 2016 01:35: > I’m plotting few dozen variables, doing so because I need to examine them > one at a time.

[R] Is there a way to coerce ggplot into using min & max values for x & y axes?

2016-07-11 Thread KMNanus
I’m plotting few dozen variables, doing so because I need to examine them one at a time. The range of these variables varies widely. One can range from -.5 to .03, another from -600 to +750. I want both axes to automatically plot from both min and max values for both continuous variables.

Re: [R-es] Red Neuronal complicada categorías

2016-07-11 Thread Javier Marcuzzi
Estimado Carlos Ortega Gracias, ahora comprendo porqué me la envió, no se si justo es la causa pero puede ser, hace dos o tres días una red no produjo resultados, la corrí otra vez y funcionó, es posible que por casualidad el valor para iniciar un número aleatorio justo no dio convergencia en

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread William Dunlap via R-help
I find that instead of using assign() and get(), it is more convenient to make an environment in which to store a related set of variables and then use env[[varName]] instead of get(varName) or assign(varName) to get and set variables. The advantages are * the same syntax works for setting and

Re: [R] [R-pkgs] archivist.github 0.2.1 on CRAN - Task View: Reproducible Research

2016-07-11 Thread David Winsemius
> On Jun 26, 2016, at 3:16 PM, Marcin Kosiński wrote: > > Hi all R devs, > > archivist.github has appeared on CRAN in it's updated version. > You can check the last blog post on how has RHero saved the Backup City > with the power or archivist and GitHub >

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread Matthew
Hi Rolf, Thanks for the warning. I think because my initial efforts used the assign function, that Jim provided his solution using it. Any suggestions for how it could be done without assign() ? Matthew On 7/11/2016 6:31 PM, Rolf Turner wrote: On 12/07/16 10:13, Matthew wrote: Hi

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread Rolf Turner
On 12/07/16 10:13, Matthew wrote: Hi Jim, Wow ! And it does exactly what I was looking for. Thank you very much. That assign function is pretty nice. I should become more familiar with it. Indeed you should, and assign() is indeed nice and useful and handy. But it should be used with

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread David Winsemius
> On Jul 11, 2016, at 1:01 PM, Matthew wrote: > > I want to get a value that has been assigned to a variable, and then use that > value to be the name of a variable. > > For example, > > tTargTFS[1,1] > # returns: >V1 > "AT1G01010" > > Now,

Re: [R-es] Red Neuronal complicada categorías

2016-07-11 Thread Carlos Ortega
Hola Javier, Las redes como otros muchos algoritmos utilizan valores aleatorios para inicializar variables, pesos, etc. Incluir un valor fijo de la semilla que genera estos números aleatorios es una forma de poder garantizar que los resultados se van a poder repetir. De esta forma, el resultado

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread Matthew
Hi Jim, Wow ! And it does exactly what I was looking for. Thank you very much. That assign function is pretty nice. I should become more familiar with it. Matthew On 7/11/2016 5:59 PM, Jim Lemon wrote: Hi Matthew, This question is a bit mysterious as we don't know what the object "chr"

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread Jim Lemon
Hi Matthew, This question is a bit mysterious as we don't know what the object "chr" is. However, have a look at this and see if it is close to what you want to do. # set up a little matrix of character values tTargTFS<-matrix(paste("A",rep(1:4,each=4),"B",rep(1:4,4),sep=""),ncol=4) # try the

Re: [R] about smwrgraphs package

2016-07-11 Thread Sarah Goslee
You really need to follow the posting guide and ask an actual question, ideally a reproducible one. Failing that, contacting the package maintainer may be the appropriate action. You're very unlikely to get much interest on the R-help list in such a vague question, but many of us are able to

Re: [R] about smwrgraphs package

2016-07-11 Thread lily li
I still haven't heard back from anyone. Please let me know as I think it is better to discuss here. On Sun, Jul 10, 2016 at 1:25 PM, lily li wrote: > Has anyone used smwrGraphs package? I have some problems and think it may > be better to discuss if you have been using it.

Re: [R] Script/function/procedure with loop

2016-07-11 Thread Sarah Goslee
Taking your question at face value, except for the factors in your original data frame, you can output anything you'd like to text onscreen using cat(). Output can also be saved to text files with sink() or using batch files, etc and so forth. date <-

Re: [R] How to make the "apply" faster

2016-07-11 Thread William Dunlap via R-help
If you use Rcpp::Rcpp.package.skeleton() to make a package out of the attached C++ code you can speed up the run counting quite a bit - to 1.4 s. from 48 s. for the 101 x 107 x 17 x 103 example. The package you make will define an R function called CountColumnRuns that computes the number of runs

[R] Script/function/procedure with loop

2016-07-11 Thread Luca Meyer
Can anyone point me to an R script/function/procedure which, starting from the following sample data #sample data #NB: nrow(df) is variable date = c("07-jul-16","07-jul-16","07-jul-16","08-jul-16","08-jul-16","08-jul-16","09-jul-16","09-jul-16") varA = c("text A1","text A2","text A3","text

Re: [R-es] Distribuciones de probabilidad

2016-07-11 Thread rafael_saturno
Ok. Muchas gracias Obtener Outlook para Android On Mon, Jul 11, 2016 at 3:59 PM -0400, "Carlos J. Gil Bellosta " wrote: Hola, ¿qué tal? La respuesta breve es no. Para los usos más habituales, sin embargo, bastaría con un mean(rXXX(1e5, ...)). Aunque

[R] use value in variable to be name of another variable

2016-07-11 Thread Matthew
I want to get a value that has been assigned to a variable, and then use that value to be the name of a variable. For example, tTargTFS[1,1] # returns: V1 "AT1G01010" Now, I want to make AT1G01010 the name of a variable: AT1G01010 <- tTargTFS[-1,1] Then, go to the next

Re: [R-es] Distribuciones de probabilidad

2016-07-11 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? La respuesta breve es no. Para los usos más habituales, sin embargo, bastaría con un mean(rXXX(1e5, ...)). Aunque cuidado . Si quieres la respuesta de libro, tendrás que consultar o deducir

Re: [R-es] Esperanza de vida librería 'demography'

2016-07-11 Thread Javier Marcuzzi
Estimada Carmen Tendría que estudiar su problema, pero posiblemente una regresión de cox, proporciona los valores, luego con estos calcular para la esperanza de vida. Yo buscaría un ejemplo en R con las siguientes palabras: r cox proportional average life expectancy Javier Rubén Marcuzzi De:

Re: [R] [FORGED] Regression with factors ?

2016-07-11 Thread Jeff Newmiller
Your clarification is promising. A reproducible example is always preferred, though never a guarantee. I expect to be somewhat preoccupied this week so responses may be rather delayed, but the less setup we have to the more likely that someone on the list will tackle it. Re an answer: If you

Re: [R] [FORGED] Regression with factors ?

2016-07-11 Thread David Winsemius
> On Jul 11, 2016, at 7:28 AM, stn021 wrote: > > Hello, > > thank you for the replies. Sorry about the html-email, I forgot. > Should be OK with this email. > > > Don't be fooled be the apparent simplicity of the problem. I have > tried to reduce it to only a single

Re: [R] How to make the "apply" faster

2016-07-11 Thread William Dunlap via R-help
How fast is fast enough and what size and shape is your dataset (show the output of str(yourData))? You will get the fastest execution time by using C or C++ or Fortran, but you will want to parameterize the problem well enough that you can amortize the time it takes to write the code over many

[R] gsl package installation problem: gsl-config not found (even though gsl has been installed)

2016-07-11 Thread pan yang
Dear R-community, I faced this problem when I tried to install the R gsl wrapper in my university's HPC cluster. Before installing the R wrapper, I have already installed the 'gsl' version 2.1 in my own directory '/home/pyangac/dev'. I have tested the gsl installation by compiling the simple

Re: [R] [FORGED] Regression with factors ?

2016-07-11 Thread stn021
Hello, thank you for the replies. Sorry about the html-email, I forgot. Should be OK with this email. Don't be fooled be the apparent simplicity of the problem. I have tried to reduce it to only a single relatively simple question. The idea here is to model cooperation of two persons. The

[R] package flexmix: models for ordinal data?

2016-07-11 Thread Xin Shelia
Hi Klaus, I saw you post “package flexmix: models for ordinal data?” on grokbase. I was wondering did you find the answer? Or what package did you use at the end? I really appreciate if you would like to help me. Best, Xin __ R-help@r-project.org

[R] [R-pkgs] archivist.github 0.2.1 on CRAN - Task View: Reproducible Research

2016-07-11 Thread Marcin Kosiński
Hi all R devs, archivist.github has appeared on CRAN in it's updated version. You can check the last blog post on how has RHero saved the Backup City with the power or archivist and GitHub http://www.r-bloggers.com/r-hero-saves-backup-city-with-archivist-and-github/ There is also going to be a

[R] [R-pkgs] New package 'forestinventory: Design-Based Global and Small-Area Estimations for Multiphase Forest Inventories'

2016-07-11 Thread Hill Andreas
Dear R users, We are happy to announce that the R package 'forestinventory: Design-Based Global and Small-Area Estimations for Multiphase Forest Inventories' is now on CRAN (https://cran.r-project.org/web/packages/forestinventory/). The aim of our package is to provide global- and smallarea

[R] Problem when installing Rmpi package in HPC cluster

2016-07-11 Thread pan yang
Dear R community, I faced this problem when I am installing the Rmpi in our university's linux86-64 cluster: > install.packages('Rmpi',repos='http://cran.r-project.org ',configure.args=c( + '--with-Rmpi-include=/usr/mpi/gcc/openmpi-1.8.2/include/', +

[R] r and fixed effect modeling

2016-07-11 Thread Cristina Cametti
Dear all, I am having problem finding a reliable code for my country fixed effects model. I have 21 countries in my database and individuals nested within them. I am running a multilevel analysis first, and then I am using the fixed effects approach to check the robustness of my findings. At

[R] [R-pkgs] new version of the package fitdistrplus

2016-07-11 Thread Marie Laure Delignette-Muller
We are pleased to announce your a new version of fitdistrplus ( https://cran.r-project.org/package=fitdistrplus). Among the new features of the package (https://cran.r-project.org/web/packages/fitdistrplus/NEWS), a FAQ vignette is now available (

[R] [R-pkgs] Seasonal PSF - Time Series Forecasting algorithm

2016-07-11 Thread Neeraj Dhanraj
Hi friends, If you are interested in univariate time series data predictions, have a look in PSF algorithm and it's R Packages available at : CRAN: https://cran.r-project.org/web/packages/PSF/index.html GitHub: https://github.com/neerajdhanraj/PSF How to use:

[R] r and country fixed effect modeling

2016-07-11 Thread Cristina Cametti
Dear all, I am having problem finding a reliable code for my country fixed effects model. I have 21 countries in my database and individuals nested within them. I am running a multilevel analysis first, and then I am using the fixed effects approach to check the robustness of my findings. At

[R] [R-pkgs] New package: simstudy

2016-07-11 Thread Goldfeld, Keith
Greetings – A new package “simstudy” is now available on CRAN. What started as a small number of functions that enabled me to quickly generate simple data sets for teaching and power/sample size calculations has grown into a more robust set of tools that allows users to simulate more complex

Re: [R] Nloptr vs Excel GRG optimization result

2016-07-11 Thread ProfJCNash
Note the "reproducible code" directive. We cannot check your calculations. It would not surprise me if the objective for Excel was really, really good BUT the parameters were out of bounds or violated other constraints. At the EUSPRIG meeting in Klagenfurt in 2004 I sat next to Dan Fijlstra of

Re: [R-es] Esperanza de vida librería 'demography'

2016-07-11 Thread Javier Marcuzzi
Estimada Carmen Martinez Olmo Yo nunca usé demography, en las dependencias no figura survival, puede ser que no haga falta porque los autores de dermography contemplaron el código necesario, pero posiblemente con survival pueda encontrar respuestas. Javier Rubén Marcuzzi De: CARMEN MARTINEZ

[R] Nloptr vs Excel GRG optimization result

2016-07-11 Thread Narendra Modi
Hi All, For a non-linear minimization optimization problem that I have, I am getting better objective function value in Excel(15) as compared to nloptr (73). the nloptr is setup as: opts = list("algorithm"="NLOPT_LN_COBYLA", "xtol_rel"=1.0e-8, "maxeval"= 1) lb =

Re: [R-es] Red Neuronal complicada categorías

2016-07-11 Thread Javier Marcuzzi
Estimado Carlos Ortega Muchas gracias por su ayuda. Tendré que estudiar RNNS, vi muy rápido el manual y parece interesante. Le consulto, usted genera un valor al azar a partir de 432, código set.seed(432) ¿432?, ¿lo calcula?, ¿es por experiencia?, si bien los datos son inventados y el

[R] Choropleth: Turnover by ZipCode

2016-07-11 Thread G . Maubach
Hi All, Dear Readers, I need to create a choropleth graph with turnover by zipcode. This is what I have so far: # Not run (Begin) # Install packages if needed # install.packages(pkgs = c("maptools", "rgdal", "RColorBrewer", "grDevices")) # Not run (End) # Load libraries library(maptools);

[R-es] Esperanza de vida librería 'demography'

2016-07-11 Thread CARMEN MARTINEZ OLMO
Buenos días, Necesito calcular la vida media de cada uno de nuestros modelos de producto pero tengo un histórico incompleto (para los productos más nuevos tengo la vida completa de las cohortes, pero para los más antiguos tengo sólo la parte final de la vida de las cohortes). He decidido