[R] Problem in adapting a script I have not written.

2016-02-18 Thread Dalila Zolarsi
Dear R users, I'm new of R, thus I apologize in advance if my following question may result a little dumb, but I really need some expert advice. I have a problem in applying someone else's code to my data. The author's code works perfectly with the examples he provides, and it seems to me I am

[R] MACRO-LOOP in R

2016-02-18 Thread Amoy Yang via R-help
I am doing the data transpose with rename as shown below (step1 ~ step4) 1. Is any way in R similar to PROC TRANSPOSE used in SAS?2. How to use MACRO-LOOP to simplify the following procedure? THANK YOU FOR HELPS! # create data for test x<-data.frame(  a=c(1,2,3),  b=c("1","2","3")); x; str(x)#

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Frank Duschek
Hi Dalila, is your function a part of a packacke or is it self-written? If you have the code it would be helpful to provide it. Frank __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Dalila Zolarsi
I forgot to attach the website in which there's all what is needed for this procedure, sorry! The text file I attach is the main standard procedure, while in the website there is all the resources for the example. If you can help me, I'd be so grateful! I think it's all self written, by the way

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Dalila Zolarsi
I'm really sorry, I forgot the attachment! I attach the main code as txt file, instead here there everything else I mentioned. I apologize if I have not been able to summarize, but I am not so proficient. Yes, the ar parameter is exactly

[R] How to create an executable file from R GUI?

2016-02-18 Thread simon0098--- via R-help
Hi, I've created a GUI using RGtk2 package. How can I make an executable file from my R script so that users click on it and the GUI appears for them? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

Re: [R] How to create an executable file from R GUI?

2016-02-18 Thread Greg Snow
To give a full answer we need some more detail from you. For example what operating system are you on? what do you mean by "users click on it"? and at what point do you want them to click (after running R, when looking at the desktop, etc.) But to help get you started you may want to look at the

Re: [R] MACRO-LOOP in R

2016-02-18 Thread Jeff Newmiller
What a mess. Transposing factors is highly unlikely to lead to sensible results. Did you look at str( x123 ) as your example created it? x <- data.frame( a=c(1,2,3), b=c("1","2","3"), stringsAsFactors=FALSE ) x123new <- setNames( as.data.frame( t( x[ , "b" ] ) ), paste( "b", 1:3, sep="_" ) )

[R] Split a character string with two separators

2016-02-18 Thread Marine Regis
Hello, >From this character string: test <-"k0298_7832_8964" how can I obtain: [[1]] "0298" Thank you very much for your help. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Split a character string with two separators

2016-02-18 Thread Ben Tupper
Hi, Will substring work for you? ?substring Cheers, Ben > On Feb 18, 2016, at 12:36 PM, Marine Regis wrote: > > Hello, > >> From this character string: > > test <-"k0298_7832_8964" > > how can I obtain: > > [[1]] > > "0298" > > Thank you very much for your

Re: [R] Split a character string with two separators

2016-02-18 Thread Ulrik Stervbo
or strsplit? test <-"k0298_7832_8964" # Split and remove letters test <- unlist(strsplit(test, "\\_")) test <- gsub("[a-z]", "", test[1]) # Split on letters and underscore test <-"k0298_7832_8964" test <- unlist(strsplit(test, "[a-z]|\\_")) test[2] On Thu, 18 Feb 2016 at 18:43 Ben Tupper

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Jeff Newmiller
d[ 3 ] means indexing some vector-like object called "d" to extract the third value. (You really need to read the Introduction to R document that comes with R, particularly about indexing. There are actually four ways to do indexing that may come up as you read other people's code.) "d" is the

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Jeff Newmiller
Looks to me like the code was not tested for an AR value of 1. Works if I set it to 2. Could be an issue of failing to use the drop=FALSE option when indexing a matrix or data frame, but I don't have time to dig thorough the code to find out where. -- Sent from my phone. Please excuse my

[R] cannot install stats package

2016-02-18 Thread T.Riedle
Dear R users, I would like to install the stats package but I get the message Warning in install.packages : package 'stats' is not available (for R version 3.2.3) How can I install stats without changing my R version? Is there an alternative package? Thanks for your help.

Re: [R] cannot install stats package

2016-02-18 Thread Duncan Murdoch
On 18/02/2016 2:45 PM, T.Riedle wrote: Dear R users, I would like to install the stats package but I get the message Warning in install.packages : package 'stats' is not available (for R version 3.2.3) How can I install stats without changing my R version? Is there an alternative package?

Re: [R] cannot install stats package

2016-02-18 Thread Sarah Goslee
The stats package is automatically installed when you install R. It's not available on CRAN because you already have it. Sarah On Thu, Feb 18, 2016 at 2:45 PM, T.Riedle wrote: > Dear R users, > I would like to install the stats package but I get the message > Warning in

[R] mclapply in foreach

2016-02-18 Thread Abdel Halloway
Can a person put mclapply in a foreach loop? Based on this post here , I wrote a script, seen here: "library(parallel) library(doParallel) cl<-makeCluster(2,outfile='') registerDoParallel(cl)

Re: [R] How to create an executable file from R GUI?

2016-02-18 Thread Zahra Samadi
OK. I should add that I want to have a shortcut on my desktop. My operating system is Windoes. I just need that when users click on this shortcut, my GUI appears without opening R environment since my users are completely unfamiliar with programming. [[alternative HTML version

Re: [R] How to create an executable file from R GUI?

2016-02-18 Thread Adrian Dușa
Simon, Greg, That is the very reason why I've given up on Tck/Tk, in favor of shiny. The user interface opens up in a webpage, without opening the normal R console (it only opens a Terminal window). To exemplify, package QCAGUI has a function called runGUI(), and on Windows it's a simple matter

Re: [R] 'tcltk' in R2.3.3

2016-02-18 Thread Duncan Murdoch
On 18/02/2016 3:03 PM, Divakar Reddy wrote: Dear R users, I would to install 'tcltk' in R2.3.3 but getting below error when I tried to install. Can you please suggest me? Don't try to install a base package. You already have it. You aren't allowed to update it. Duncan Murdoch

Re: [R] 'tcltk' in R2.3.3

2016-02-18 Thread Uwe Ligges
On 18.02.2016 21:03, Divakar Reddy wrote: Dear R users, I would to install 'tcltk' in R2.3.3 but getting below error when I tried to install. Can you please suggest me? install.packages("tcltk", repos = "http://cran.cnr.Berkeley.edu/;); Installing package into ‘/usr/lib64/R/library’ (as

[R] 'tcltk' in R2.3.3

2016-02-18 Thread Divakar Reddy
Dear R users, I would to install 'tcltk' in R2.3.3 but getting below error when I tried to install. Can you please suggest me? > install.packages("tcltk", repos = "http://cran.cnr.Berkeley.edu/;); Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) Warning message: package

[R] Help with Allele frequency correlation

2016-02-18 Thread Busisiwe Mlotshwa
Hi, I am trying to correlate allele frequencies for two populations. My datasets are binary (bed, bim, fam), exported from Plink and read into R using read.plink (snpStats). I want to generate a correlation matrix for the two populations and thought I would use cor.test (method = “spearman”)

[R] Looking for a data set - Teratology data of Chen and Kodell (1989)

2016-02-18 Thread Ravi Varadhan
Hi, I am looking for the teratology data set from the Chen and Kodell (JASA 1989) on mice exposed to different doses of a chemical, DEHP. This was also analyzed in a Biometrics 2000 paper by Louise Ryan using GEE. I think this data set is publicly available, but I am unable to locate it.

Re: [R] 'tcltk' in R2.3.3

2016-02-18 Thread Bob Kot
I believe you mean - "tcltk2" which refers to Tcl/Tk Additions - https://cran.r-project.org/web/packages/tcltk2/index.html Kind regards, Bob -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Divakar Reddy Sent: Thursday, February 18, 2016 3:03 PM To:

[R] Reading a datetime vector

2016-02-18 Thread D Wolf via R-help
Hello,I am trying to read a data frame column named DateTimeStamp. The time is in GMT in this format: 1/4/2013 23:30 require(xlsx) df2_TZ = read.xlsx2("DF_exp.xlsx", sheetName = "Sheet1") It's good to that line. But these three lines, which makes the dataframe, converts the column's values to

[R] Geody - geolocated spots on a sphere ("planet")

2016-02-18 Thread Valerio Capello
Hi, I'm the developer at Geody, the geospatial web tool. I've recently added support for the R language (requires rgl module), so that you can choose one or multiple places on Earth or other planets of the Solar Systems and get a script that shows a 3D planet with 3D dots of the selected places.

Re: [R] Reading a datetime vector

2016-02-18 Thread Jeff Newmiller
You are being rather scattershot in your explanation, so I suspect you are not being systematic in your troubleshooting. Use the str function to examine the data column after you pull it in from excel. It may be numeric, factor, or character, and the approach depends on which that function

Re: [R] Reading a datetime vector

2016-02-18 Thread Jim Lemon
Hi Doug, For one thing, you may be using the wrong format. Your example format has no seconds field. The other thing to watch is whether the data are in %m/%d/%Y or %d/%m/%Y date format. If the latter, you would probably get that error on dates like 19/02/2016. Jim On Fri, Feb 19, 2016 at 8:12

[R-es] Efectos de la regresion logistica

2016-02-18 Thread Milagros Camacho
Buenas tardes a todos: Tengo un problema al interpretar los coeficientes de una regresión logística. Tengo varios grupos de variables predictoras que son indicadoras o dummy variables y representan todos los días de la semana y todas las horas del día. Al meter en el modelo, por ejemplo,

Re: [R-es] Efectos de la regresion logistica

2016-02-18 Thread Olivier Nuñez
En la formula de la regresión pon "-1": y ~ -1 + Dia Así te quitas la constante del modelo, y los efectos que estimas para cada dia ya no son relativos. En realidad, tu interpretación es correcta y interpretar el efecto de un día respecto al otro, es facil de comunicar. Un saludo. Olivier

Re: [R-es] Efectos de la regresion logistica

2016-02-18 Thread Milagros Camacho Bellido
Hola: Gracias por tu respuesta. Ya había pensado en tu idea, pero si quitó el término independiente el modelo resultante es peor, tiene mucho menos porcentaje de acierto. Además en el conjunto de las variables horas del día sigue quitando una variable como me pasaba para días de la semana,

Re: [R-es] Efectos de la regresion logistica

2016-02-18 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Las predicciones del modelo con y sin término independiente (i.e., dia + hora + ... y -1 + dia + hora + ...) deberían ser exactamente las mismas. Puedes usar distintos tipos de contrastes (como aquí ) para