Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback #1
base: feedback
Are you sure you want to change the base?
Feedback #1
Changes from 3 commits
0c2fe28
9176358
3da87fc
6eaca9b
eb3963d
b64fe83
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edad
es un número, no tiene sentido la comparación el texto "18". Igual acá creo R te salva porque automáticamente hace la conversión a texto y luego compara en órden alfabético y justo coincide con el orden numérico. Pero la comparación tiene que ser con18
, no con"18"
(idem para 70).Esto está repetido otras veces en el código.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acá también el código devuelve tablas enteras y no guarda la selección ni el filtro. Recordá que la tabla nunca se modifica, sino que las acciones de filtrar, seleccionar, etc... devuelven un nueva tabla con el resultado de esas acciones. Para guardar ese resultado hay que asignarlo a una variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto devuelve lo mismo que está más arriba salvo que agrega una columna con el valor constante "Varon". No hace falta poner ese
"Varon"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto te está dando
NA
porque estás calculando la media del texto"estudio_educacion"
que, como es un texto, no tiene media. Tenés que sacarle las comillas.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El
na.rm = TRUE
tiene que ir dentro de las funcionesmax
,sd
, etc. Acá está como un argumento asummarize()
y lo que hace es agregar una columna con el nombre na.rm y valor TRUE. En estos casos no hay valores faltantes, así que no hace falta que lo pongas.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto también devuelve un montón de datos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En el código la agrupación está comentada así que no corre. El grupo no selecciona únicamente a los varones. Quizás este texto te quedó de una versión anterior del código?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para hacer este gráfico lo que te conviene es usar
pivot_longer()
para alargar la tabla y luego usar un sologeom_line()
. Algo así:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ojo que en los datos ya hay una variable llamada
rango_etario
que tiene la edad categorizada por rango. Si querés hacer un recorte con otras edades, podés usar la funcióncut()
para crear una nueva variableedad_categorica
(o como quieras llamarla) con la edad por rangos y luego agrupar por esa variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acá podrías no filtrar por edad para ver toda la curva.
Large diffs are not rendered by default.