[R] SVAR: error message

2018-10-22 Thread John
Hi, I have a bi-variate VAR model and would like to convert it to SVAR but get an error message. Could someone pinpoint anything wrong and correct my code? Thanks, John amat <- matrix(c(NA, 0, NA, NA), nrow = 2, ncol = 2, byrow = TRUE) df1<-data.frame(x=c(1,4,5,6,7,8,9,3,5,3),

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread John Laing
I don't know much about the Tidyverse, but more generally the way to represent ordered categorical data is with a factor. This seems to work: > testset$Observation <- factor(testset$Observation, levels=c("One", "Two", "Three")) > testset$Label <- factor(testset$Label, levels=c("Western",

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Bert Gunter
For clarity's sake: ** Stop posting in HTML.** Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Oct 22, 2018 at 4:55 PM Joel Maxuel wrote: > For

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Joel Maxuel
For clarity sake. More show (with example closer to reality), less tell. :^) ## Current: > library(knitr) > library(tidyverse) ── Conflicts ─ tidyverse_conflicts() ── x dplyr::filter() masks stats::filter() x dplyr::lag()

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Jeff Newmiller
If you are willing to work in the context of LaTeX output then perhaps you will find the "tables" package useful. However, while you think you have communicated clearly enough regarding what you want to accomplish, I do not, so either someone else will intuit what you want or you will create a

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Joel Maxuel
Hi Jeff, Thanks for the input, however it does not seem we are on the same wavelength. Maybe I should have distilled my example down even further to solidify context, although given what I was trying to accomplish I believe it is all in context. At this point I am not concerned about presenting

Re: [R-es] Chapuza total?? Crear web con R

2018-10-22 Thread José Luis Cañadas
Cierto. Pero en nuestro caso funcionó por qué se levantaban máquinas de Amazon aitomaticamente si nos quedábamos sin recursos. Tal vez la opción buena sea lo que te comentaban de shiny asíncrono con future y promises El lun., 22 oct. 2018 22:40, Jesús Para Fernández <

Re: [R-es] Chapuza total?? Crear web con R

2018-10-22 Thread José Luis Cañadas
Una solución que he visto es usar dockers. En mi antiguo curro hicimos varias viz hechas en shiny que estaba en un docker y las gestionaba shinyproxy. El tema era que todo estaba en aws y teníamos un administrador de sistemas muy bueno que me lo montó detrás de un balanceador de forma que cada vez

Re: [R-es] Chapuza total?? Crear web con R

2018-10-22 Thread Víctor Granda García
Buenas! Espero que no sea una locura total o mi trabajo se va al garete jeje. Bromas aparte, si quieres ejemplos "profesionales", la oficina de turismo de Nueva Zelanda tiene su dashboard hecha en shiny ( http://tourismdashboard.mbie.govt.nz/), así que poder, se puede hacer. Como este hay unos

Re: [R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Jeff Newmiller
IMO your question is flawed in that it does not present a desired output. One thought that occurs to me is that perhaps you should stop treating everything like a nail and use some different tools, like nest and a for loop: library(knitr) library(tibble)

Re: [R-es] Agregar variable entre dos fechas

2018-10-22 Thread Carlos Ortega
Pues: 1. Que entre esos rangos de fechas haya un NA. La forma de protegerse es indicándoselo al cálculo de la media. datos[Fecha >= '2016-12-21' & Fecha <= '2016-12-28',.(rating.sem = mean(Rating, *na.rm =TRUE* )),by=Id.producto] 2. Que las fechas, tu variable "Fecha" no sea realmente una fecha.

Re: [R-es] Agregar variable entre dos fechas

2018-10-22 Thread Miriam Alzate
Muchas gracias por la respuesta pero me da NA. �Qu� puede ocurrir? Un saludo El 22/10/2018 a las 20:12, Jes�s Para Fern�ndez escribi�: > Puedes hacerlo pasando tus datos a data.frame > > library(data.table) > datos <- data.table(datos) > datos[Fecha >= '2016-12-21' & Fecha <=

Re: [R-es] Agregar variable entre dos fechas

2018-10-22 Thread Jesús Para Fernández
Puedes hacerlo pasando tus datos a data.frame library(data.table) datos <- data.table(datos) datos[Fecha >= '2016-12-21' & Fecha <= '2016-12-28',.(rating.sem = mean(Rating)),by=Id.producto] Un saludo Jes�s Obtener Outlook para Android De: Miriam Alzate Enviado: lunes,

Re: [R] Different stack barplots - same color legends

2018-10-22 Thread Richard M. Heiberger
Try the likert function in install.packages("HH) ## if necessary library(HH) Then using David Carlson's example teamq likert(teamq) Your example in the 1:30PM (Eastern Daylight Time) doesn't work. Error in revalue(teamq, c(`de situatie in zeer geringe mate van toepassing is\nvoor u of uw

[R-es] X Jornadas de R (Murcia). Plantea tu trabajo y recibe feedback

2018-10-22 Thread Antonio Maurandi López
En el las X Jornadas de R  que se celaban en Murcia, Fac de Economía y Empresa los próximos 22 y 23 de nov de 2018, se podrán presentar trabajos en primicia, de modo que podréis recibir feedback  sobre el planteamiento metodológico, modelos y de aprovechamiento de los datos. Apuntate ya!

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Am 22.10.18 um 18:02 schrieb Bert Gunter: I suggest you spend a bit of time with an R tutorial or two and, in particular learn about "logical indexing," as this basic R construct seems to be mysterious to you. Hi Bert, especially the "match" help area is a little bit confusing. And

Re: [R] Different stack barplots - same color legends

2018-10-22 Thread P. Roberto Bakker
Dear David, Thank you for you quite response. My apologies for not giving some sample data - this is due to AVG. *But this minisample should not be a problem (all in Dutch)*: teamq # A tibble: 4 x 2 `Ik volg bijscholing om mijn opleiders-kwaliteiten op peil te houden` 1 de situatie in

Re: [R] Polygon

2018-10-22 Thread David L Carlson
Putting it all together: z1<- -1 z2<- 2 oldp <- par(mgp=c(3, .5, 0)) curve(dnorm(x,0,1), xlim=c(-5, 5),main="Standard Normal", xaxt="n", frame=F, xlab="") jj<-seq(z1,z2,0.01) cord.x<- jj cord.y<- dnorm(jj) polygon(c(-1, cord.x, 2), c(0, cord.y, 0), col="skyblue")

[R-es] Agregar variable entre dos fechas

2018-10-22 Thread Miriam Alzate
Buenas, Tengo un dataframe con 64.000 observaciones llamado Datos y las variables "Id.Producto","Fecha"y "Rating" . La variable fecha tiene el formato: 2016-12-28 (ymd). Quiero crear la variable: "Rating.Semanal" - Esta variable tiene que ser la media agregada por "Id.Producto" de la

Re: [R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Ivan Krylov
This is a bin\R.exe + bin\Rscript.exe bug. On Windows, where the system call to create a process only takes one command line string instead of an array of command line parameters[0] (and the C runtimes usually call CommandLineToArgvW[1] behind the scenes to get an array back), execv() does

[R] Transformations in Tidyverse (renaming and ordering columns)

2018-10-22 Thread Joel Maxuel
Hello all, I am slowly picking away at a factsheet that will include several result sets from a single tibble (there is a column identifying the section title) and would like to have that value in the top left corner of each resulting table. When using the `spread` function, I see that any

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Bert Gunter
I suggest you spend a bit of time with an R tutorial or two and, in particular learn about "logical indexing," as this basic R construct seems to be mysterious to you. Cheers, Bert On Mon, Oct 22, 2018 at 8:22 AM Knut Krueger wrote: > Am 22.10.18 um 17:01 schrieb Eric Berger: > > v <-

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Am 22.10.18 um 17:01 schrieb Eric Berger: v <- match(Mydata$DATA1, needles, nomatch=NA) > found <- Mydata[ !is.na (v), ] > missing <- Mdata[ is.na (v), ] Thank you it is working, additionally as Bert suggested, it seems that Mydata[Mydata$DATA1 %in% needles,] is

Re: [R] Different stack barplots - same color legends

2018-10-22 Thread David L Carlson
Your example is not reproducible since you did not give us some sample data. I suspect that your data frame consists of columns that represent questions and rows that represent individuals who answered the questions. First create a simple example: set.seed(42) teamq <-

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Eric Berger
Hi Knut, You are almost done. > v <- match(Mydata$DATA1, needles, nomatch=NA) > found <- Mydata[ !is.na(v), ] > missing <- Mdata[ is.na(v), ] HTH, Eric On Mon, Oct 22, 2018 at 5:51 PM Bert Gunter wrote: > Re-read ?match and note the examples for %in% > > -- Bert > Bert Gunter > > "The

Re: [R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Marc Capavanni via R-help
Hi Tomas, You're likely right, I didn't restart, unplug/replug the hard drive, or even close CMD, so I can give that a go. Thanks for your insight. In any case I think I'll go with the solution of using 3.5.1 as it seems to solve the issue, and would mean I wouldn't have to modify hard drive or

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Bert Gunter
Re-read ?match and note the examples for %in% -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Oct 22, 2018 at 7:38 AM Knut Krueger wrote: > > Hi

[R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Hi to all I would like to reduce the "Mydata" to rows, only if Mydata$Data1 are in needles needles =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431, 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203,

[R] Different stack barplots - same color legends

2018-10-22 Thread P. Roberto Bakker
Hi, I want to make barplots from different questions (columns) in one data.frame. Each question has the same 5 likert items. Now the problem: in some questions all items are answered; in other less. >From the syntax below I get nice stack barplots - *but the legend colors do not* refer to the

Re: [R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Tomas Kalibera
Dear Marc, this is probably because short file names are disabled on that external drive. R needs short file names to be enabled on the drive where it is installed - please check/follow according to Microsoft documentation on turning on Short File Names (SFN, aka 8.3 names, 8dot3 names).

[R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Marc Capavanni via R-help
Hi all, This is my second time posting this, I accidentally sent the first email without the proper subject header. Hopefully this won't create any noise and a moderator can dismiss the first one. I'm considering filing this as a bug report but wanted to make sure first that I'm not doing

Re: [R] Polygon

2018-10-22 Thread David L Carlson
Yes, par(oldp) resets the parameter to its original value. The simplest way to get the area in this case would be to use pnorm(): > pnorm(2) - pnorm(-1) [1] 0.8185946 If you have an arbitrary polygon, you can use polyarea() in the pracma package: > library(pracma) > polyarea(rev(c(-1, cord.x,

[R] Cannot use R on Windows when installed to an external drive with a space in the path

2018-10-22 Thread Marc Capavanni via R-help
Hi all, I'm considering filing this as a bug report but wanted to make sure first that I'm not doing something wrong. A piece of software which I develop installs R as part of its dependencies. This normally works perfectly fine. However we noticed a bug when installing to external drives on a

Re: [R-es] Error al pasar consulta a shiny

2018-10-22 Thread Víctor Granda García
Hola Jesús, En vez de renderText, prueba renderPrint. El problema creo que se debe a que renderText pasa un data.frame (una lista al fin y al cabo) a "cat" y eso da error (pej cat(iris) te da exactamente el mismo error) *Víctor Granda García* Data Technician v.gra...@creaf.uab.cat Tel. +34 93

Re: [R] (no subject)

2018-10-22 Thread PIKAL Petr
Hi first of all few comments Does your email client have subject line? If yes please use it, if not, change the client. Please do not post in HTML, such emails have big chance to be scrambled. # this gives you 10 random numbers x<-rnorm(10,0,1) f<-fuction(u,x) {exp(x- u)} # you probably ment

Re: [R] object 'nativeRoutines' not found

2018-10-22 Thread Guido Kraemer
FYI, the problem just fixed itself. On 9/24/18 3:43 PM, Guido Kraemer wrote: Hi all, Since a couple of days travis-ci fails for my package coRanking with "R: devel". The error message is: Error in nativeRoutines[[lib]] <- routines : object 'nativeRoutines' not found "R: release" and "R: