[R-es] GRAFICO DE BARRAS
Javier Marcuzzi
j@v|er@ruben@m@rcuzz| @end|ng |rom gm@||@com
Lun Mayo 9 23:12:18 CEST 2022
Estimados
Había un problema si no funcionaba, se me ocurrió algo y lo probé, anda, lógicamente desconozco si era el mismo problema que yo tuve, pero la diferencia estaba en como importaba el archivo.
El código con al diferencia, comenté en R lo que cambie por otra forma de importar los dados.
library(tidyverse)
#dtk <- read.csv('data/raw/presiones.csv',
# sep = ',', dec = ',')
library(readxl)
dtk <- read_excel("Downloads/presiones.xlsx")
dtk %>%
pivot_longer(cols = names(dtk)) %>%
group_by(name) %>%
summarise(sum(value)) %>%
ungroup() %>%
mutate( valor = `sum(value)`) %>%
ggplot() +
geom_bar(aes(y = valor, x = name, fill = name), stat = 'identity’)
Javier Rubén Marcuzzi
> El 9 may. 2022, a las 13:54, Jose Betancourt Bethencourt <betanster using gmail.com> escribió:
>
> ENVEZ DE SUM USÉ MEDIAN QUE ES LO QUE ME CONVIENE, GRACIAS!!
>
>
> library(readxl)
> ta <- read_excel("C:/Users/betan/Desktop/presiones.xlsx")
> attach(ta)
>
> '
>
> ta %>%
> pivot_longer(cols = names(ta)) %>%
> group_by(name) %>%
> summarise(median(value)) %>%
> ungroup() %>%
> mutate( valor = `median(value)`) %>%
> ggplot() +
> geom_bar(aes(y = valor, x = name, fill = name), stat = 'identity')
>
>
>
>
>
>
>
> El 9/5/22, Juan Abasolo <juan.abasolo using ehu.eus <mailto:juan.abasolo using ehu.eus>> escribió:
>> Seguro que te lo saben resolver muchísimo más elegante.
>> Pero si te sirve para desatascarte, acá mi ejercicio
>>
>> Suerte
>>
>> library(tidyverse)
>> dtk <- read.csv('data/raw/presiones.csv',
>> sep = ',', dec = ',')
>>
>> dtk %>%
>> pivot_longer(cols = names(dtk)) %>%
>> group_by(name) %>%
>> summarise(sum(value)) %>%
>> ungroup() %>%
>> mutate( valor = `sum(value)`) %>%
>> ggplot() +
>> geom_bar(aes(y = valor, x = name, fill = name), stat = 'identity')
>>
>>
>>
>>
>> Hau idatzi du Jose Betancourt Bethencourt (betanster using gmail.com)
>> erabiltzaileak (2022 mai. 9, al. (14:24)):
>>
>>> Estimados
>>>
>>> ?Como se hace un gráfico de barras con este archivo que adjunto en
>>> que cada barra represente a una columna y tenga diferente color?
>>> -- saludos
>>> José
>>> _______________________________________________
>>> R-help-es mailing list
>>> R-help-es using r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>>>
>>
>>
>> --
>> Juan Abasolo, PhD
>>
>> Hizkuntzaren eta Literaturaren Didaktika Saila | EUDIA ikerketa taldea
>> Bilboko Hezkuntza Fakultatea
>> Euskal Herriko Unibertsitatea UPV/EHU
>>
>> Sarriena auzoa z/g 48940 - Leioa (Bizkaia)
>>
>> T : (+34) 94 601 7567
>> Telegram: @JuanAbasolo
>> Skype : abasolo72
>>
>
>
> --
> Dr. Jose A. Betancourt Bethencourt
> Universidad de Ciencias Medicas Carlos j. Finlay
>
> _______________________________________________
> R-help-es mailing list
> R-help-es using r-project.org <mailto:R-help-es using r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-help-es <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