[R-es] CALCULAR SALDO DE CUENTA CORRIENTE
Emilio L. Cano
em||opezc@no @end|ng |rom gm@||@com
Dom Sep 13 10:44:09 CEST 2020
Prueba:
arrange(FECHA) en vez de group_by(FECHA)
Un saludo,
Emilio
> El 13 sept 2020, a las 4:42, Jesus MARTIN F. <jmfpas using gmail.com> escribió:
>
> Pido ayuda para calcular el SALDO
>
> *DATAFRAME:*
> ASIENTO FECHA CUENTA CONCEPTO ARS_DEB ARS_HAB
> SALDO
>
> 1 1 2020-01-01 40100006 Asiento de Apertura 0 199517.
> -199517.
> 2 231 2020-01-13 40100006 15/01 CH53677071 GALICIA 14054. 0
> 14054.
> 3 231 2020-01-13 40100006 20/01 CH22406030 CREDICOO 9458. 0
> 23511.
> 4 231 2020-01-13 40100006 EFECTIVO 98637. 0
> 122148.
> 5 256 2020-01-13 40100006 S/F20-A-363538 ART028 0 56892.
> 65256.
> 6 256 2020-01-13 40100006 S/F20-A-363538 ART011 0 9266.
> 55990.
> 7 256 2020-01-13 40100006 30-65527599-8 20-A-363538 0 13893.
> 42096.
> 8 256 2020-01-13 40100006 30-65527599-8 20-A-363538 0 2646.
> 39450.
> 9 256 2020-01-13 40100006 30-65527599-8 20-A-363538 0 1985.
> 37465.
>
> *SENTENCIA QUE ESTOY UTILIZANDO:*
> #ORDENAR FILAS POR FECHA Y CALCULAR SALDO
> Diario_Serie5 <- Diario_Serie5 %>%
> group_by(FECHA) %>%
> mutate(SALDO = cumsum(ARS_DEB)-cumsum(ARS_HAB))
>
> Me está calculando bien la primera fila, pero luego a partir de la segunda,
> no está funcionando bien.
>
> Agradezco mucho la ayuda que me puedan dar.
>
> Jesús
>
>
>
> _________________
>
> *Jesús MARTÍN FRADE *
> Skype: jmfpas
> Tel (celular): (011) 154-946-2131 (Argentina)
> (+54) 911-4946-2131 (Internacional)
> Facebook http://www.facebook.com/jesusmartinfrade
>
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
> Remitente
> notificado con
> Mailtrack
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
> 12/09/20
> 23:38:40
>
> [[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
Más información sobre la lista de distribución R-help-es