[R-es] Agregar variable entre dos fechas
Miriam Alzate
miri@m@@lz@te @ending from un@v@rr@@e@
Lun Oct 22 20:34:24 CEST 2018
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 <= '2016-12-28',.(rating.sem =
> mean(Rating)),by=Id.producto]
>
> Un saludo
> Jes�s
>
> Obtener Outlook para Android <https://aka.ms/ghei36>
>
>
>
> De: Miriam Alzate
> Enviado: lunes, 22 de octubre 19:27
> Asunto: [R-es] Agregar variable entre dos fechas
> Para: r-help-es
>
>
> 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 variable "Rating", solo teniendo en cuenta
> aquellas observaciones que est�n entre el "2016-12-21" y "2016-12-28".
> Muchas gracias Miriam _______________________________________________
> R-help-es mailing list R-help-es using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>
[[alternative HTML version deleted]]
Más información sobre la lista de distribución R-help-es