[R-es] RV: fechas
Disculpen, A veces me falla el otro correo y lo reenvío por este De: R-help-es [mailto:r-help-es-boun...@r-project.org] En nombre de jbetancourt Enviado el: sábado, 16 de enero de 2016 05:49 Para: 'Lista R'CC: luisfo89 Asunto: [R-es] fechas Estimados Muchas gracias por su ayuda. No he logrado convertir los datos de climas diarios a datos por semana, es decir que junto a la identificación de las semanas, quisiera que los datos climaticos de cada semana se reflejaran en cada semana .Adjunto datos Ejemplo semana48 Max.TemperatureF Mean.TemperatureF Min.TemperatureF etc Perdonen mis limitados conocimientos LOS SCRIPT ENVIADOS FUNCIONARON PARA IDENTIFICAR LA SEMANA # rm(list = ls()) #setwd("D:/Public/Documents/R/r_epidemiología/") datIn <- read.table("clima.csv", header=T, as.is=TRUE, sep=",") datIn library(lubridate) #datIn$fecha <- mdy(datIn$CST) datIn$semana <- week(datIn$fecha) datIn$semana ## library("lubridate") data <- read.csv("clima.csv", stringsAsFactors=F) # mdy() para formato m/d/y. existe dmy() para formato d/m/y woy <- week(mdy(data$CST)) #week of year woy SEMANAS 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 [28] 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 [55] 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 12 12 12 [82] 12 12 12 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15 15 15 15 16 16 16 [109] 16 16 16 16 17 17 17 17 17 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 19 20 20 [136] 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23 23 23 23 23 24 [163] 24 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 [190] 28 28 28 28 28 28 28 29 29 29 29 29 29 29 30 30 30 30 30 30 30 31 31 31 31 31 31 [217] 31 32 32 32 32 32 32 32 33 33 33 33 33 33 33 34 34 34 34 34 34 34 35 35 35 35 35 [244] 35 35 36 36 36 36 36 36 36 37 37 37 37 37 37 37 38 38 38 38 38 38 38 39 39 39 39 [271] 39 39 39 40 40 40 40 40 40 40 41 41 41 41 41 41 41 42 42 42 42 42 42 42 43 43 43 [298] 43 43 43 43 44 44 44 44 44 44 44 45 45 45 45 45 45 45 46 46 46 46 46 46 46 47 47 [325] 47 47 47 47 47 48 48 48 48 48 48 48 49 49 49 49 49 49 49 50 50 50 50 50 50 50 51 [352] 51 51 51 51 51 51 52 52 52 52 52 52 52 53 -- Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/ clima.csv Description: Binary data ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R-es] fechas
Hola: Creo que esta es la solución que buscas. datIn$semana <- week( mdy( datIn$CST ) ) datIn$semana plot( datIn$semana, datIn$PrecipitationIn, pch = 20, cex = 0.3 ) Te adjunto un fichero .Rmd para que lo verifiques in situ. Saludos El 16/01/16 a las 11:49, jbetancourt escribió: Estimados Muchas gracias por su ayuda. No he logrado convertir los datos de climas diarios a datos por semana, es decir que junto a la identificación de las semanas, quisiera que los datos climaticos de cada semana se reflejaran en cada semana .Adjunto datos Ejemplo semana48 Max.TemperatureF Mean.TemperatureF Min.TemperatureF etc Perdonen mis limitados conocimientos LOS SCRIPT ENVIADOS FUNCIONARON PARA IDENTIFICAR LA SEMANA # rm(list = ls()) #setwd("D:/Public/Documents/R/r_epidemiología/") datIn <- read.table("clima.csv", header=T, as.is=TRUE, sep=",") datIn library(lubridate) #datIn$fecha <- mdy(datIn$CST) datIn$semana <- week(datIn$fecha) datIn$semana ## library("lubridate") data <- read.csv("clima.csv", stringsAsFactors=F) # mdy() para formato m/d/y. existe dmy() para formato d/m/y woy <- week(mdy(data$CST)) #week of year woy SEMANAS 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 [28] 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 [55] 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 12 12 12 [82] 12 12 12 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15 15 15 15 16 16 16 [109] 16 16 16 16 17 17 17 17 17 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 19 20 20 [136] 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23 23 23 23 23 24 [163] 24 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 [190] 28 28 28 28 28 28 28 29 29 29 29 29 29 29 30 30 30 30 30 30 30 31 31 31 31 31 31 [217] 31 32 32 32 32 32 32 32 33 33 33 33 33 33 33 34 34 34 34 34 34 34 35 35 35 35 35 [244] 35 35 36 36 36 36 36 36 36 37 37 37 37 37 37 37 38 38 38 38 38 38 38 39 39 39 39 [271] 39 39 39 40 40 40 40 40 40 40 41 41 41 41 41 41 41 42 42 42 42 42 42 42 43 43 43 [298] 43 43 43 43 44 44 44 44 44 44 44 45 45 45 45 45 45 45 46 46 46 46 46 46 46 47 47 [325] 47 47 47 47 47 48 48 48 48 48 48 48 49 49 49 49 49 49 49 50 50 50 50 50 50 50 51 [352] 51 51 51 51 51 51 52 52 52 52 52 52 52 53 ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es -- ___ José Antonio Palazón Ferrando Profesor Titular. Departamento de Ecología e Hidrología. Facultad de Biología. Universidad de Murcia. Campus Universitario de Espinardo 30100 MURCIA-SPAIN Telf: +34 868 88 49 80 Fax : +34 868 88 39 63 Email: pala...@um.es http://webs.um.es/palazon --- title: "Untitled" author: "palazon" date: "16 de enero de 2016" output: html_document --- Estimados Muchas gracias por su ayuda. No he logrado convertir los datos de climas diarios a datos por semana, es decir que junto a la identificación de las semanas, quisiera que los datos climaticos de cada semana se reflejaran en cada semana. # Solución (creo) 1. Datos y librerÃas ```{r} library(lubridate) datIn <- read.table( "clima.csv", header = T, as.is = TRUE, sep = "," ) head( datIn ) names( datIn ) ``` 2. Cálculo de la semana para una fecha dada Tendremos en cuenta que es una fecha escrita como _mes, dÃa, año_; usamos la función `mdy()` para obtener una "fecha" y de ella extraemos la semana con la funcion `week()`. Calculamos y comprobamos con un gráfico. ```{r} datIn$semana <- week( mdy( datIn$CST ) ) datIn$semana plot( datIn$semana, datIn$PrecipitationIn, pch = 20, cex = 0.3 ) ``` ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R-es] heatmap de matriz diagonal inferior
Hola, Si ya tienes la matriz, puedes usar la orden heatmap.2 del paquete gplots, que te hace el heatmap y además te dibuja los dendrogramas. Para ver la ayuda de la orden carga primero el paquete y luego ?heatmap.2 Si m es tu matriz, con: m[upper.tri(m)] <- t(m)[upper.tri(m)] consigues que la diagonal superior sea el "espejo" de la inferior y puedes usar heatmap.2 sin problema: heatmap.2(m, ) donde indica el resto de opciones que quieres para el heatmap. Espero que te sirva, un saludo! El sáb., 16 ene. 2016 a las 10:46, Carlos Ortega () escribió: > Hola, > > ¿Por qué no importas todos los datos y haces todo en R?. > >- Importas datos. >- Haces matriz de correlaciones con "cor()" >- Y con el paquete "corrplot" haces todos esos gráficos que quieres. > > Saludos, > Carlos. > > El 16 de enero de 2016, 10:29, Daviz Parra escribió: > > > Tengo una matriz de de datos (correlación) entre pares de muestras, de > tipo > > diagonal inferior, de 250 y quisiera hacer un heatmap y/o un dendrograma. > > > > Soy un poco novato y me encuentro con el problema que no se como > > "importarla" para cargarla e indicar que se trata de una matriz de datos > de > > tipo "diagonal inferior" para que R lo interprete y poder realizar un > > heatmap y/o dendrograma (así como cualquier otro tipo de representación > y/o > > análisis) > > Parece ser sencillo, pero he buscado por internet y no doy con ello, por > > eso recurro a esta lista. > > ¿Podrían ayudarme? > > > > Gracias > > > > [[alternative HTML version deleted]] > > > > ___ > > R-help-es mailing list > > R-help-es@r-project.org > > https://stat.ethz.ch/mailman/listinfo/r-help-es > > > > > > -- > Saludos, > Carlos Ortega > www.qualityexcellence.es > > [[alternative HTML version deleted]] > > ___ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
[R] featurised matrix factorisation in R
Hi, I want to perform non-negative featurised Matrix factorisation in ‘R’. Is there any ‘R' package or documentation that explains on this ? Regards, Sunny [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing tikzDevices for R 3.2.3
Ranjan Maitra inbox.com> writes: > > On Fri, 15 Jan 2016 21:25:06 -0600 Ranjan Maitra inbox.com> wrote: > > > Hi, > > > > I wanted to install tikzDevices on a installation of > R (3.2.3) on a new machine. However, I am getting: > > > > > install.packages('tikzDevices') > > > > Warning message: > > package ‘tikzDevices’ is not available (for R version 3.2.3) > > > > Is there any way out for me other than wait for the tikzDevices to be updated in the repos? I am on Fedora 23 > with everything up to date. > > > > Many thanks in advance for any suggestions and best wishes, > > Ranjan > > Sorry to answer my own question, but I found a way out > (only specific to tikzDevices): > > install.packages("tikzDevice", repos="http://R-Forge.R-project.org;) This is all a little bit surprising since tizkDevice seems perfectly fine on CRAN: https://cran.rstudio.com/web/packages/tikzDevice/index.html What are getOption("repos") and sessionInfo() ? Perhaps there is some temporary binary-building delay because R 3.2.3 just came out? Did you try install.packages("tikzDevice", type="source") ? __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] The "cloud" CRAN server.
In another thread you wrote: One note: The "cloud" CRAN server is nowadays reachable as https://cloud.r-project.org and that is now the preferred URL. Should I understand from this that it is considered advisable that I use this URL as my default repository for downloading R and contributed packages from CRAN? Rather than making use of my "local mirror" (in my case http://cran.stat.auckland.ac.nz)? I have set options(repos="https://cloud.r-project.org;) in my .Rprofile, and everything seems to work, and go like a train. Are there any disadvantages to so doing? cheers, Rolf -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Ordinal regression with some categories combined for some data
Hi I have never seen germination experiments carried out as ordinal regression. Most germination tests are done using a nls model. For some species germination may only start a week after planting and then germinate over 2 or 3 days. If all germinated over the experimental period and there is no change in germination between readings then read them accordingly. If there are ungerminated seeds at the end; have these then had germinable tests been applied to them?. I agree with Thierry about survival analysis. If however you are wanting to get into latency then ordinal models may be OK Another package to do ordinal regression is VGAM Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bob O'Hara Sent: Saturday, 16 January 2016 01:49 To: r-help Subject: [R] Ordinal regression with some categories combined for some data Hi! I've been asked about a problem where I think I can see how to write the model, but don't know if it's been implemented in R. It's not something I work on a lot, so I'm hoping someone else can point me to an answer straight away. The researcher has been carrying out germination experiments: lost of seeds are put in several conditions (temperature humidity etc.), and every few days they are checked to see if they have germinated. Because the days are discrete I think it makes sense to view this as an ordinal regression problem (rather than as an interval censored survival analysis). But what makes this tricky is that there are days when the researcher only checked some seeds. So for some seeds the germination might fall into more than one category. Is there a package in R that can handle this, i.e. do an ordinal regression where for some observations the categories are interval censored? Or is it easier to go straight to a full interval-censored survival analysis? Bob -- Bob O'Hara Biodiversity and Climate Research Centre Senckenberganlage 25 D-60325 Frankfurt am Main, Germany Tel: +49 69 798 40226 Mobile: +49 1515 888 5440 WWW: http://www.bik-f.de/root/index.php?page_id=219 Blog: http://occamstypewriter.org/boboh/ Journal of Negative Results - EEB: www.jnr-eeb.org __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rjags loading error
Hi What version of JAGS are you using JAGS 4.0.0 is current library(rjags) Loading required package: coda Linked to JAGS 4.0.0 Loaded modules: basemod,bugs Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Dalthorp, Daniel Sent: Saturday, 16 January 2016 08:24 To: r-help@r-project.org Subject: [R] rjags loading error What has happened?! I get the following error message when I try to load rjags package (w/ Windows 7)... > require(rjags) Loading required package: rjags Error in get(method, envir = home) : lazy-load database 'C:/Program Files/R/R-3.2.3/library/rjags/R/rjags.rdb' is corrupt In addition: Warning messages: 1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], : restarting interrupted promise evaluation 2: In get(method, envir = home) : restarting interrupted promise evaluation 3: In get(method, envir = home) : internal error -3 in R_decompress1 I was able to use this package successfully a few months ago. Has something changed? Yes, I upgraded to R 3.2.3, but would that break the package? Any help would be greatly appreciated! Thanks. -Dan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R-es] fechas
Hola, Creo que no hemos terminado de entenderte. Voy a intentarlo nuevamente. - De cada día de la semana tienes un conjunto de medidas: Max_Temp, Min_Temp, - ¿Lo que quieres es agrupar estas medidas por semana?. Si agrupas, entonces como de cada tienes siete medidas de cada variables. Al agrupar ¿quieres la media de cada una de esas medidas? ¿la media de las máximas, la media de las mínimas, etc...?. Si eso es lo que quieres esta es una forma: #- datIn_mean <- aggregate(datIn[,c(2:21,23)], by=list(Semana= as.factor(datIn$semana)), FUN=mean, data=datIn) #- Que da este resultado (una parte)...: > head(datIn_mean) Semana Max.TemperatureF Mean.TemperatureF Min.TemperatureF Max.Dew.PointF 1 1 82.28571 75.14286 68.0 62.14286 2 2 82.0 74.42857 67.0 61.28571 3 3 83.57143 74.85714 66.42857 61.71429 Saludos, Carlos Ortega www.qualityexcellence.es El 16 de enero de 2016, 11:49, jbetancourtescribió: > > Estimados > > Muchas gracias por su ayuda. No he logrado convertir los datos de climas > diarios a datos por semana, es decir > > que junto a la identificación de las semanas, quisiera que los datos > climaticos de cada semana se reflejaran > en cada semana .Adjunto datos > Ejemplo > semana48 Max.TemperatureF Mean.TemperatureF Min.TemperatureF etc > Perdonen mis limitados conocimientos > > LOS SCRIPT ENVIADOS FUNCIONARON PARA IDENTIFICAR LA SEMANA > # > rm(list = ls()) > #setwd("D:/Public/Documents/R/r_epidemiología/") > datIn <- read.table("clima.csv", header=T, as.is=TRUE, sep=",") > datIn > library(lubridate) > #datIn$fecha <- mdy(datIn$CST) > datIn$semana <- week(datIn$fecha) > datIn$semana > ## > library("lubridate") > data <- read.csv("clima.csv", stringsAsFactors=F) > # mdy() para formato m/d/y. existe dmy() para formato d/m/y > woy <- week(mdy(data$CST)) #week of year > woy > SEMANAS > > 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 > 4 > > [28] 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 > 8 8 8 > > [55] 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 > 12 12 12 > > [82] 12 12 12 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15 15 15 15 > 16 16 16 > > [109] 16 16 16 16 17 17 17 17 17 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 > 19 20 20 > > [136] 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23 23 23 > 23 23 24 > > [163] 24 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26 26 26 26 27 27 27 27 > 27 27 27 > > [190] 28 28 28 28 28 28 28 29 29 29 29 29 29 29 30 30 30 30 30 30 30 31 31 31 > 31 31 31 > > [217] 31 32 32 32 32 32 32 32 33 33 33 33 33 33 33 34 34 34 34 34 34 34 35 35 > 35 35 35 > > [244] 35 35 36 36 36 36 36 36 36 37 37 37 37 37 37 37 38 38 38 38 38 38 38 39 > 39 39 39 > > [271] 39 39 39 40 40 40 40 40 40 40 41 41 41 41 41 41 41 42 42 42 42 42 42 42 > 43 43 43 > > [298] 43 43 43 43 44 44 44 44 44 44 44 45 45 45 45 45 45 45 46 46 46 46 46 46 > 46 47 47 > > [325] 47 47 47 47 47 48 48 48 48 48 48 48 49 49 49 49 49 49 49 50 50 50 50 50 > 50 50 51 > [352] 51 51 51 51 51 51 52 52 52 52 52 52 52 53 > -- Saludos, Carlos Ortega www.qualityexcellence.es [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R] installing tikzDevice for R 3.2.3
On Sat, 16 Jan 2016 04:45:58 + Ben Bolkerwrote: > Ranjan Maitra inbox.com> writes: > > > > > On Fri, 15 Jan 2016 21:25:06 -0600 Ranjan Maitra > inbox.com> wrote: > > > > > Hi, > > > > > > I wanted to install tikzDevices on a installation of > > R (3.2.3) on a new machine. However, I am getting: > > > > > > > install.packages('tikzDevices') > > > > > > Warning message: > > > package ‘tikzDevices’ is not available (for R version 3.2.3) > > > > > > Is there any way out for me other than wait for the tikzDevices to be > updated in the repos? I am on Fedora 23 > > with everything up to date. > > > > > > Many thanks in advance for any suggestions and best wishes, > > > Ranjan > > > > Sorry to answer my own question, but I found a way out > > (only specific to tikzDevices): > > > > install.packages("tikzDevice", repos="http://R-Forge.R-project.org;) > > This is all a little bit surprising since tizkDevice seems > perfectly fine on CRAN: > https://cran.rstudio.com/web/packages/tikzDevice/index.html > > What are getOption("repos") and sessionInfo() ? > Perhaps there is some temporary binary-building delay because > R 3.2.3 just came out? > >Did you try install.packages("tikzDevice", type="source") ? I am sorry: I made an error earlier -- I made a mistake (used the plural instead of 'tikzDevices'). This was a false alarm. Apologies for that! However, while I don't know if this would be possible to get from an error message but it would have been preferred if the message had said that there was no such package in R, rather than say that the package is not available for R version 3.2.3 which led me to believe that an updated version was not available. However, at the end of a long day, it was my mistake: sorry again for that! Best wishes, Ranjan > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Important Notice: This mailbox is ignored: e-mails are set to be deleted on receipt. Please respond to the mailing list if appropriate. For those needing to send personal or professional e-mail, please use appropriate addresses. FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] featurised matrix factorisation in R
> On 16 Jan 2016, at 12:22, Sandeep Rana> wrote: > > Hi, > I want to perform non-negative featurised Matrix factorisation in ‘R’. Is > there any ‘R' package or documentation that explains on this ? > Well I don't know about the "featurised" but googling on (you didn't do that?) non-negative featurised Matrix factorisation R found this: https://cran.r-project.org/web/packages/NMF/index.html Berend > Regards, > Sunny > [[alternative HTML version deleted]] > No html please. > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] use gcheckbox in gWidgets to switch on/off gframe
Dear All, I’m trying to create a GUI using gWidgets. I would like to have a checkbox to “switch on/off” different frames within the GUI. Ideally if one frame is switched on, all other frames would be switched off. Unfortunatly I only came as far as this: library(gWidgets) Population <- c("A","B","C","D","E","F") w = gwindow("") g1 = ggroup(horizontal = F, cont=w) g2 = ggroup(horizontal = T, cont=g1) glabel("Population:", cont=g2) Station = gcombobox(Population, editable=F, cont=g2, handler=NULL) gseparator(horizontal=T, container=g1, expand=F) gcheckbox("checked", container=g1, handler=function(h,...) { enabled ( frame1 ) <- cat(svalue(h$obj)) }) frame1 <- gframe ( "A:" , cont = g1 , horizontal=FALSE ) lyt1 <- glayout ( cont = frame1) widget_list <- list ( ) lyt1 [1,1] <- "A1:" lyt1 [1,2,expand = TRUE] <- (widget_list$A1 <- gedit(" ", cont=lyt1, handler=NULL)) lyt1 [2,1] <- "A2:" lyt1 [2,2,expand = TRUE] <- (widget_list$A2 <- gedit(" ", cont=lyt1, handler=NULL)) gcheckbox("checked", container=g1, handler=function(h,...) { enabled ( frame2 ) <- cat(svalue(h$obj)) }) frame2 <- gframe ( "B:" , cont = g1 , horizontal=FALSE ) lyt2 <- glayout ( cont = frame2) widget_list <- list ( ) lyt2 [1,1] <- "B1:" lyt2 [1,2, expand = TRUE] <- (widget_list$B1 <- gedit(" ", cont=lyt2, handler=NULL)) When I type in: enabled ( frame2 ) <- F; enabled ( frame2 ) <- T it does what I would like it to do. But when I check the checkbox it will only work once. Thank you for any suggestions! Tonja __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing tikzDevice for R 3.2.3
> Ranjan Maitra> on Fri, 15 Jan 2016 23:46:19 -0600 writes: > Yihui, Thanks very much! Explicitly specifying the RStudio > server works, and I have reinstalled tikzDevice > Best wishes, Ranjan Good, and thanks to Yihui indeed! One note: The "cloud" CRAN server is nowadays reachable as https://cloud.r-project.org and that is now the preferred URL. Rstudio is currently still paying the service -> Thank you JJ and Rstudio staff! -- but that may not have to remain so, and the R Foundation and R Core team are much happier to have a generic https://cloud.r-project.org as "default CRAN mirror". Martin Maechler (as 'Secreatry General' of the R Foundation) > On Fri, 15 Jan 2016 22:42:41 -0600 Yihui Xie > wrote: >> Please do not use http://r-forge.r-project.org/ to >> install tikzDevice. We no longer update tikzDevice on >> R-Forge. It may be a problem of your CRAN mirror. When in >> doubt, try the RStudio mirror (the chance that Amazon >> CloudFront is down should be much smaller than a single >> metal server somewhere): >> >> install.packages("tikzDevice", >> repos="https://cran.rstudio.com;) # make sure your >> version of R supports https >> >> Regards, Yihui >> -- >> Yihui Xie Web: http://yihui.name >> >> >> On Fri, Jan 15, 2016 at 9:37 PM, Ranjan Maitra >> wrote: > On Fri, 15 Jan >> 2016 21:25:06 -0600 Ranjan Maitra >> wrote: >> > >> >> Hi, >> >> >> >> I wanted to install tikzDevices on a installation of R >> (3.2.3) on a new machine. However, I am getting: >> >> >> >> > install.packages('tikzDevices') >> >> >> >> Warning message: >> package ‘tikzDevices’ is not >> available (for R version 3.2.3) >> >> >> >> Is there any way out for me other than wait for the >> tikzDevices to be updated in the repos? I am on Fedora 23 >> with everything up to date. >> >> >> >> Many thanks in advance for any suggestions and best >> wishes, >> Ranjan >> > >> > >> > Sorry to answer my own question, but I found a way out >> (only specific to tikzDevices): >> > >> > install.packages("tikzDevice", >> repos="http://R-Forge.R-project.org;) >> > >> > It would be nice to have a general approach, especially >> when R updated does not mostly mean that packages >> installed under and earlier version of R stop working. >> > >> > Best wiehes, > Ranjan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Aggregate records to 10min
Hi I would like to aggregate a rainfall series with 1min records (timestamp and value of 0.1mm from a tipping bucket raingauge) to 10min values by summing up the values. # ptime is a POSIXlt datetime value with tz="GMT" t10min <- 600*floor(as.integer(as.POSIXct(data$ptime))/600) w10min <- tapply(data$value, format(as.POSIXct(t10min, tz="GMT", origin = "1970-01-01"), "%Y-%m-%d %H:%M"), sum) write.table(as.matrix(w10min),"data 10min.txt", row.names=TRUE, col.names=FALSE, quote=FALSE) This code works but I would like to have the result in datetime format of %m/%d/%Y %H:%M. When I output this format the records are not chronologically sorted but text-sorted because dimnames of w10min is of type character (because of the format function). Is there an easier way summing up the records to 10min records? Thanks, Rolf __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] use gcheckbox in gWidgets to switch on/off gframe
Hi Tonja I removed the cat(...) in the event handlers because cat writes TRUE or FALSE to the console but doesn't seem to return a value. Then it worked. You should initialize the frames to be disabled or the checkboxes to be checked that both states are consistant. Regards, Rolf tonja.krue...@web.de wrote: Dear All, I’m trying to create a GUI using gWidgets. I would like to have a checkbox to “switch on/off” different frames within the GUI. Ideally if one frame is switched on, all other frames would be switched off. Unfortunatly I only came as far as this: library(gWidgets) Population <- c("A","B","C","D","E","F") w = gwindow("") g1 = ggroup(horizontal = F, cont=w) g2 = ggroup(horizontal = T, cont=g1) glabel("Population:", cont=g2) Station = gcombobox(Population, editable=F, cont=g2, handler=NULL) gseparator(horizontal=T, container=g1, expand=F) gcheckbox("checked", container=g1, handler=function(h,...) { enabled ( frame1 ) <- cat(svalue(h$obj)) }) frame1 <- gframe ( "A:" , cont = g1 , horizontal=FALSE ) lyt1 <- glayout ( cont = frame1) widget_list <- list ( ) lyt1 [1,1] <- "A1:" lyt1 [1,2,expand = TRUE] <- (widget_list$A1 <- gedit(" ", cont=lyt1, handler=NULL)) lyt1 [2,1] <- "A2:" lyt1 [2,2,expand = TRUE] <- (widget_list$A2 <- gedit(" ", cont=lyt1, handler=NULL)) gcheckbox("checked", container=g1, handler=function(h,...) { enabled ( frame2 ) <- cat(svalue(h$obj)) }) frame2 <- gframe ( "B:" , cont = g1 , horizontal=FALSE ) lyt2 <- glayout ( cont = frame2) widget_list <- list ( ) lyt2 [1,1] <- "B1:" lyt2 [1,2, expand = TRUE] <- (widget_list$B1 <- gedit(" ", cont=lyt2, handler=NULL)) When I type in: enabled ( frame2 ) <- F; enabled ( frame2 ) <- T it does what I would like it to do. But when I check the checkbox it will only work once. Thank you for any suggestions! Tonja __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Rolf Fankhauser Hegenheimerstrasse 129 4055 Basel Tel. 061 321 45 25 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Ordinal regression with some categories combined for some data
Dear Bob, I don't know any package that handles ordinal data the way you are looking for. I'd just would comment on the ordinal regression. Would the time of loss be the ordinal response? That seems inefficient to me when you have a lot of time points (= lots of ordinal classes). IMHO the survival analysis would make more sense. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2016-01-15 16:48 GMT+01:00 Bob O'Hara: > Hi! > > I've been asked about a problem where I think I can see how to write > the model, but don't know if it's been implemented in R. It's not > something I work on a lot, so I'm hoping someone else can point me to > an answer straight away. > > The researcher has been carrying out germination experiments: lost of > seeds are put in several conditions (temperature humidity etc.), and > every few days they are checked to see if they have germinated. > Because the days are discrete I think it makes sense to view this as > an ordinal regression problem (rather than as an interval censored > survival analysis). But what makes this tricky is that there are days > when the researcher only checked some seeds. So for some seeds the > germination might fall into more than one category. > > Is there a package in R that can handle this, i.e. do an ordinal > regression where for some observations the categories are interval > censored? Or is it easier to go straight to a full interval-censored > survival analysis? > > Bob > > -- > Bob O'Hara > > Biodiversity and Climate Research Centre > Senckenberganlage 25 > D-60325 Frankfurt am Main, > Germany > > Tel: +49 69 798 40226 > Mobile: +49 1515 888 5440 > WWW: http://www.bik-f.de/root/index.php?page_id=219 > Blog: http://occamstypewriter.org/boboh/ > Journal of Negative Results - EEB: www.jnr-eeb.org > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Panel plots for means of cyclical observations
Hi Continuing on from the data.frame code for z that you supplied Using the data without summarizing first z$mth = format(date "%m") z$mth = format(date, "%m") xyplot(rainfall ~ as.numeric(mth), z, groups = yr, type = "l", auto.key = T, scales = list(x = list(at = 1:12, labels = month.abb, rot = 60)), panel = panel.superpose, panel.groups = function(x,y, ...){ panel.average(x,y, fun = mean, horizontal = FALSE, ...) } ) ## xyplot You may want to look into the zoo package as it has several date grouping functions. untested z.tom <- aggregate(rainfall ~ year +month, z, mean, na.rm = T) xyplot(rainfall ~ month, z.tom, groups = year, scales = ... , panel = panel.superpose) Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kieran Sent: Friday, 15 January 2016 22:16 To: R-help@r-project.org Subject: [R] Panel plots for means of cyclical observations I want to create a panel plot using xyplot of a line graph whose x-axis is months of the year and y-axis is the average rainfall in a given month over the 6 years the data spans. There should be two levels in this panel plot: odd and even months. Creating this plot without splitting it into levels is quite straightforward (creating a for loop to compute a vector of averages) but the approach is not useful if you want to split the plots into different levels. Here is the code: dfmt <- "%d/%m/%Y" date <- seq(as.Date("01/01/2010", dfmt), as.Date("31/12/2015", dfmt), "day") month <- months(date) rainfall <- runif(2191, 0, 150) monthsOfYear <- c("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") parity <- match(month, monthsOfYear) %% 2 # even parity = 0, odd parity = 1 z <- data.frame(rainfall, date, month, parity) The problem with using xyplot( y ~ x | f, data=z .. ) is the x and y I want to plot are not columns in z but rather some kind of statistical summary of columns. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.