[R] mlogit.optim start values problem

2015-11-12 Thread Alaa Sindi
Hello All, I received the following message and I think it is regarding start values or the method. semsem = mlogit.optim ( LL=LL*Prob[i,1] , start = c(1,1,1), method = c("bfgs"), iterlim = 2000, tol = 1E-05, ftol = 1e-08, steptol = 1e-10, print.level = 2) + + } Error in as.name(f[[2]]) :

Re: [R] "haven" - read_spss: How to avoid extracting value labels instead of long labels?

2015-11-12 Thread Dimitri Liakhovitski
Looks like a little bug in 'haven': When I actually look at the attributes of one variable that has no long label in SPSS but has Value Labels, I am getting: attr(spss1$WAVE, "label") NULL But when I sapply my function longlabels to my data frame and ask it to print the long labels for each

Re: [R] "haven" - read_spss: How to avoid extracting value labels instead of long labels?

2015-11-12 Thread Dimitri Liakhovitski
I have to rephrase my question again - it's clearly a small bug in haven. Here is what it is about: If I have a column in SPSS that has BOTH a long label and value labels, then everything works fine - I access one with 'label' and another with 'labels': attr(spss1$MYVAR, "label") [1] "LONG

[R] extraction of parameters for intercept from "lavaan" object

2015-11-12 Thread Dimitri Liakhovitski
I am using 'lavaan' to estimate a single indicators model. My model itself looks like this: sem1model <- ' Imp ~ Ux Mem ~ Ux + Imp AE ~ Imp + Mem + Ux UL ~ Ux + Imp + AE ' sem1 <- sem(sem1model, data = mydata) I am getting a decent fit and want to use this model. My unstandardized coefficient

Re: [R] Compute Regressions with R-Function

2015-11-12 Thread Bert Gunter
No function is necessary for multiple lhs's. lm() allows a matrix as it's lhs and will fit a separate regression for each column of the matrix. Please read ?lm carefully for details. For that matter, please read the linked Help pages and/or spend some time with a tutorial (there are many on the

Re: [R] Quotes

2015-11-12 Thread Jim Lemon
Hi Daniel, As David said, these problems are almost always due to fancy quotes. If you want plain old ASCII 34 (double) or 39 (single) quotes, try using Notepad for your editing rather than Word. Jim On Thu, Nov 12, 2015 at 5:02 PM, David Winsemius wrote: > > > On Nov

Re: [R] recursive partitioning in R

2015-11-12 Thread Therneau, Terry M., Ph.D.
Look at the rpart vignette "User written split functions". The code allows you to add your own splitting method to the code (in R, no C required). This has proven to be very useful for trying out new ideas. The second piece would be to do your own cross-validation. That is, turn off the

[R] *.rpt data

2015-11-12 Thread Mangalani Peter Makananisa
Hi, Could you please assist, how do I load the rpt data into R without converting it first to csv? Kind regards Peter Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Pages/Email-disclaimer.aspx [[alternative

Re: [R] Problems using save to store NAMED R objects

2015-11-12 Thread Duncan Murdoch
On 12/11/2015 6:41 PM, Julio Sergio Santana wrote: I have to store (in a file) an R object that was created with is name as a string of characters, as follows: : nn <- "xxx" : assign(nn, 5) : xxx [1] 5 I don't want to store the object nn but the object xxx. I tried the

[R] Problems using save to store NAMED R objects

2015-11-12 Thread Julio Sergio Santana
I have to store (in a file) an R object that was created with is name as a string of characters, as follows: : nn <- "xxx" : assign(nn, 5) : xxx [1] 5 I don't want to store the object nn but the object xxx. I tried the following two expressions but none of them worked: :

Re: [R] Problems using save to store NAMED R objects

2015-11-12 Thread Julio Sergio Santana
Thanks Duncan, I just saw another, but similar, solution for this in http://stackoverflow.com/questions/11084395/save-object-using-variable-with-object-name , and it is: : save(list=nn, file="f.RData") Thanks again, -Sergio. On Thu, Nov 12, 2015 at 8:57 PM, Duncan Murdoch

Re: [R] *.rpt data

2015-11-12 Thread PIKAL Petr
Hi Please keep conversation on list, others may have better opinion than myself. The attachment is not welcomed when posting to R help list, you can post error message directly to your mail. Anyway, you will hardly get any useful answer if you keep your cards hidden. You shall at least show

Re: [R] *.rpt data

2015-11-12 Thread PIKAL Petr
Hi If it is really "like" csv data you can import it by read.csv... or you can use any other read.* function. Did you try it? If yes, what was the result? If not, why not? Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sarah >

Re: [R] *.rpt data

2015-11-12 Thread John McKown
On Thu, Nov 12, 2015 at 7:52 AM, PIKAL Petr wrote: > Hi > > If it is really "like" csv data you can import it by > > read.csv... > > or you can use any other read.* function. > > Did you try it? If yes, what was the result? > If not, why not? > > Cheers > Petr > ​Purely

Re: [R] *.rpt data

2015-11-12 Thread Sarah Goslee
On Thursday, November 12, 2015, Mangalani Peter Makananisa < pmakanan...@sars.gov.za> wrote: > .rpt is one of the data extension like .csv, .txt , ….. > > All extensions are 'data extensions' in some sense. Without knowing quite a bit more about YOUR rpt extension, it's impossible to answer. >

Re: [R] How to calculate variance on multiple numbers at once?

2015-11-12 Thread Luigi Marongiu
Essentially the problem is related to this problem. I am measuring the fluorescence (flu) generated over time (clock) from 5 samples (samp) which are grouped by two targets (targ). I can calculate the variance of the fluorescence for each sample at a given time (in this example, for sample 1); but

Re: [R] *.rpt data

2015-11-12 Thread Sarah Goslee
What is "rpt data"? What source produced it? Where did you get it? Is it associated with particular software? Is it ascii or binary? Sarah On Thursday, November 12, 2015, Mangalani Peter Makananisa < pmakanan...@sars.gov.za> wrote: > Hi, > > Could you please assist, how do I load the rpt data

Re: [R] *.rpt data

2015-11-12 Thread David L Carlson
Another possibility for .rpt files from file-extensions.org: "The rpt file extension is frequently used for various reports - output files of programs, often used for further analyze. Probably the most common type of RPT format is the one exported by Crystal Reports. Crystal Reports is a

Re: [R] mlogit.optim start values problem

2015-11-12 Thread Jim Lemon
Hi Alaa, >From the code you sent, I think that the error may be in one or more lines preceding the call to mlogit.optim. The "+" prompt means that the R interpreter thinks there is more to come, and when you added a right brace ("}"), it probably tried to interpret everything back to the last left

Re: [R] recursive partitioning in R

2015-11-12 Thread ACD
Dear Terry, Thanks for pointing me to your vignette. I can't say that I fully understand it however. I'd be grateful for your help with a couple of specific questions: * In my application, each potential split will be a function of the outcome (y), as well as two other variables (p1

Re: [R] Compute Regressions with R-Function

2015-11-12 Thread Nordlund, Dan (DSHS/RDA)
You may have additional scoping problems depending on where you various variables exist, but your Trend function syntax is incorrect. You need parentheses around your arguments to the lm call, and you left out the '~' in your formula. In addition, don't fool yourself by your use of the names

Re: [R] Compute Regressions with R-Function

2015-11-12 Thread Michael Dewey
In-line On 12/11/2015 16:27, Matthias Worni wrote: Hello I was trying to set up a function() that allows easely to calculate regressions for severel dependent variables with the same independent variables. My function looked like this but was turned down by an error (Im quiet new to R

Re: [R] Plot with pauses?

2015-11-12 Thread Greg Snow
Here is one option if you don't want to write the explicit for loop (there is still a loop): library(TeachingDemos) v<-0:60 z<-3/5+4i/5 t<-z^(v/9) tmpfun <- function(npoints) { plot( Re(t)[seq_len(npoints)], Im(t)[seq_len(npoints)], xlab="Real", ylab="Imaginary", xlim=c(-1,1),

Re: [R] Compute Regressions with R-Function

2015-11-12 Thread Jeff Newmiller
Your email is severely damaged because you sent it using HTML format. Please adjust the settings in your email software to use only plain text when sending to this list so we can see what you see. While you are at it you should read about making your examples reproducible [1]... it may seem

Re: [R] problem in R

2015-11-12 Thread Marco
Excerpts from Rolf Turner's message of 2015-11-06 00:34:06 -0200: > > On 06/11/15 14:31, Jim Lemon wrote: > > > > > The fundamental problem that has emerged in this discussion is that > > you seem to be applying the method of post-modernist deconstruction > > to programming in R. I see no

Re: [R] replace NA's with row means for specific columns

2015-11-12 Thread Marco
Excerpts from Zahra via R-help's message of 2015-11-02 17:49:01 -0200: > Hi there, > > I am looking for some help replacing missing values in R with the row mean. > This is survey data and I am trying to impute values for missing variables in > each set of questions separately using the mean of

Re: [R] Quotes

2015-11-12 Thread Daniel Wiegert
Thank you. This was helpful. I'll try it. Daniel Wiegert > On Nov 12, 2015, at 1:11 AM, Jim Lemon wrote: > > Hi Daniel, > As David said, these problems are almost always due to fancy quotes. If you > want plain old ASCII 34 (double) or 39 (single) quotes, try using

[R] "haven" - read_spss: How to avoid extracting value labels instead of long labels?

2015-11-12 Thread Dimitri Liakhovitski
Hello! I don't have an example file, but I think my question should be clear without it. I have an SPSS file. I read it in using 'haven': library(haven) spss1 <- read_spss("SPSS_Example.sav") I created a function that extracts the long labels (in SPSS - "Label"): fix_labels <- function(x,

[R] Compute Regressions with R-Function

2015-11-12 Thread Matthias Worni
Hello I was trying to set up a function() that allows easely to calculate regressions for severel dependent variables with the same independent variables. My function looked like this but was turned down by an error (Im quiet new to R Studio). So here is my solution: b CO2 logTrop_Aerosol lm(b

Re: [R-es] Una ayudita

2015-11-12 Thread daniel
Heber, Agrego: http://kbroman.org/pkg_primer/ http://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/ (comenzaría por éste por lo resumido) Si usas RStudio fíjate en su sitio el tutorial para Build / Project build tools: Package.

Re: [R-es] Problema con la lectura de datos

2015-11-12 Thread Isidro Hidalgo
Completando lo que ya te han dicho, si grabas un CSV desde Excel, 3 cosas más: - Selecciona todas las columnas vacías a la derecha de tus datos y elimínalas (no vale con borrar el contenido, usa el botón derecho y "Eliminar...") - Selecciona todas las filas vacías abajo de tus datos y elimínalas

Re: [R-es] Problema con la lectura de datos

2015-11-12 Thread miguel.angel.rodriguez.muinos
Otra opción es importar directamente los datos que necesites usando XLConnect (sin llevarlos a CSV). Ese paquete permite hacer cosas muy potentes desde el propio fichero de Excel. https://cran.r-project.org/web/packages/XLConnect/index.html Recomiendo, encarecidamente, la lectura de sus dos

Re: [R-es] Problema con la lectura de datos

2015-11-12 Thread Isidro Hidalgo
Yo también uso XLConnect y me va muy bien. Isidro Hidalgo Arellano Observatorio del Mercado de Trabajo Consejería de Economía, Empresas y Empleo http://www.castillalamancha.es/ > -Mensaje original- > De: R-help-es [mailto:r-help-es-boun...@r-project.org] En nombre de > Francisco

Re: [R-es] Problema con la lectura de datos

2015-11-12 Thread Bartolomé Marcos , José Antonio
El problema de XLConnect es que necesita java para funcionar y en equipos con poca memoria puede dar problemas. Por eso, yo aconsejo openxlsx (para Excel 2007 o superior) que no necesita de ningún programa externo. -Mensaje original- De: R-help-es

Re: [R-es] Una ayudita

2015-11-12 Thread Francisco Rodriguez Sanchez
Hola Heber, Sin dudar, el libro de Hadley Wickham: http://r-pkgs.had.co.nz/ (acceso gratis online) Suerte Paco El 12/11/2015 a las 18:11, heber sarmiento via R-help-es escribió: Quisiera saber si alguien me puede ayudar con documentación o el lugar donde encontrarla, relacionada con la

Re: [R-es] problema as.numeric

2015-11-12 Thread Fernando Macedo
Otra cosa que se puede hacer con factors es usar as.numeric(as.character(x$factor)) Saludos DMTV Fernando Macedo Asistente del área Mejoramiento Genético Facultad de Veterinaria - UdelarR - Uruguay Tel: 26284291 Cel.: 098596947 ferm...@gmail.com El 10/11/2015 a las 04:47 p.m., Javier Rubén

[R-es] Una ayudita

2015-11-12 Thread heber sarmiento via R-help-es
Quisiera saber si alguien me puede ayudar con documentación o el lugar donde encontrarla, relacionada con la elaboración de paquetes en R, tengo algunos script programados y quiero convertirlos en paquetes; he leído el manual para hacer extensiones pero quiero algo más sintético y practico,