Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

R-Script Code, necesita Y-AXIS para mostrar Count

Hola a todos -

He estado jugando con esta curva de distribución y esperaba poder ajustar el eje Y para mostrar la frecuencia de recuento.

¿Es posible?

Echa un vistazo al código de abajo.

Y eche un vistazo a la visualización que está produciendo actualmente.

Conjunto de datos de ejemplo:

Este es un conjunto de datos de ejemplo

Código:

library(ggplot2)
ggplot(data=dataset,aes(x=dataset$Performance)) +
    geom_histogram(aes(y=..density..),col="#ffffff",fill="#004253") +
    labs(title="Business Unit", x="Performance Ratings", y="Frequency") +
    geom_density(col=2) +
    stat_function(fun = dnorm, 
        args = list(mean = mean(dataset$Performance, na.rm = TRUE), 
                    sd = sd(dataset$Performance, na.rm = TRUE)), 
                    colour = 'blue') 

Visualización:

Histogram.PNG

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hola @GradStudent2020 ,

No tengo acceso a su conjunto de datos.

Para agregar etiquetas del eje Y, puede hacer referencia a este vínculo (el 4o gráfico 😞

https://stats.idre.ucla.edu/r/faq/how-can-i-add-features-or-dimensions-to-my-bar-plot/

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Uy. . . . este es el vínculo al conjunto de datos de ejemplo.

Estoy buscando transformar el eje y de 0.0, 0.2, 0.4, 0.6 (densidad) - para mostrar el recuento de puntos de datos que contribuye al histograma. Voy a echar un vistazo al recurso que has compartido.

Muchas gracias por su ayuda!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.