[R-es] Tabla dinamica R

Carlos Ortega cof @ending from qu@lityexcellence@e@
Jue Mayo 24 21:29:16 CEST 2018


Hola,

Si crees que con un equivalente a las "PivotTables" de Excel lo
solucionarías...
Puedes usar esto:

https://cloud.r-project.org/web/packages/pivottabler/index.html


pivottabler: Create Pivot Tables in R

Create regular pivot tables with just a few lines of R. More complex pivot
tables can also be created, e.g. pivot tables with irregular layouts,
multiple calculations and/or derived calculations based on multiple data
frames. Pivot tables are constructed using R only and can be written to a
range of output formats (plain text, 'HTML', 'Latex' and 'Excel'),
including with styling/formatting.
Saludos,
Carlos Ortega
www.qualityexcellence.es


El 24 de mayo de 2018, 19:59, Santiago Repetto <santiagopnssypr using gmail.com>
escribió:

> Hola!
>
> Solicito ayuda con un data frame relativamente grande ¿? del cual necesito
> generar una tabla dinámica a la manera excel.
> Si me pueden referenciar algún comando, paquete, pagina web y/o cualquier
> ayuda que me puedan dar será muy bienvenida.
>
> Lo que tengo que hacer es pasar de algo así:
>
> NombreMunicipio NombreProvincia Categoria idMedicamento CodMedicamento
> CodMedicamentoOL UnidadesEnvSec
> CAPITAL CORDOBA CENTRO DE ATENCION PRIMARIA DE LA SALUD 117 72 CLCA072 1
> CAPITAL CORDOBA CENTRO DE ATENCION PRIMARIA DE LA SALUD 117 72 CNVC070 144
> RIO CUARTO CORDOBA CENTRO DE ATENCION PRIMARIA DE LA SALUD 117 72 CMJA085
> 28
> CAPITAL CORDOBA CENTRO DE ATENCION PRIMARIA DE LA SALUD 811 250 CNPA250 50
> RIO CUARTO CORDOBA CENTRO DE ATENCION PRIMARIA DE LA SALUD 811 250 CLCA072
> 1
> RIO CUARTO CORDOBA HOSPITAL PUBLICO 811 250 CNPA250 50
> BERAZATEGUI BUENOS AIRES CENTRO DE ATENCION PRIMARIA DE LA SALUD 262 301
> CIHA301 1
> BERAZATEGUI BUENOS AIRES CENTRO DE ATENCION PRIMARIA DE LA SALUD 262 301
> CNPA251 25
> TIGRE BUENOS AIRES CENTRO DE ATENCION PRIMARIA DE LA SALUD 262 301 CNQA071
> 35
> TIGRE BUENOS AIRES CENTRO DE ATENCION PRIMARIA DE LA SALUD 815 628 CO6A628
> 1
> TIGRE BUENOS AIRES CENTRO DE ATENCION PRIMARIA DE LA SALUD 815 628 CNPA070
> 144
>
>
> pasar, seleccionando algunos campos (rótulos de fila, rótulos de columna y
> valores del excel), a algo así:
>
>
> NombreProvincia NombreMunicipio 117 262 811 815
> BUENOS AIRES BERAZATEGUI 26
>   TIGRE 35 145
> Total BUENOS AIRES     61   145
> CORDOBA CAPITAL 145 50
>   RIO CUARTO 28 51
> Total CORDOBA   173   101
>
> Muchas gracias desde ya y perdón por las molestias.
>
> Saludos y buen fin de semana!
>
> Santiago
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-help-es mailing list
> R-help-es using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

	[[alternative HTML version deleted]]



Más información sobre la lista de distribución R-help-es