Skip to content
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

Cross Section Identifier Problem #10

Open
KardelenCicek opened this issue Mar 15, 2022 · 1 comment
Open

Cross Section Identifier Problem #10

KardelenCicek opened this issue Mar 15, 2022 · 1 comment

Comments

@KardelenCicek
Copy link

I have panel data for many countries and many years. When I choose the country column as a cross-sectional identifier it doesn't recognize countries and I can't produce country-level graphs. I only see graphs based on years. Also I am getting that error:
Warning: Error in : Column name Years must not be duplicated.
Use .name_repair to specify repair.
Caused by error in stop_vctrs():
! Names must be unique.
x These names are duplicated:

  • "Years" at locations 1 and 2.
    202:
    geom_smooth() using method = 'loess' and formula 'y ~ x'
    Warning: Removed 1 rows containing missing values (position_stack).
    Warning: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead.
@joachim-gassen
Copy link
Owner

Hi there and sorry for the delay. This seems to be related to the structure of your data. Are you providing a data frame to Expand or are you uploading data? If you are still having issues and provide a data frame to Expand() could you please the structure of you data frame (str(df)). Alternatively, I would need access to your data to see what is going on.

If this is not feasible, maybe comparing the structure of your data with the structure of the package's example World Bank data could give you an idea about how to proceed. You can call the raw version of this data with ExPanD as follows:

library(ExPanDaR)
ExPanD(worldbank, cs_id = "country", ts_id = "year")

You will see that by default, ExPanD does not offer graphing by the cross-section as in most real-life cases there are too many units in the cross-section for meaningful visualisation. You can, however, add an additional country identifier to your data frame and then prepare graphs along that one. In the example above, you can create visuals along, for example, iso3c, but, as mentioned above, these are not really informative given that there are too many countries in the sample. Aggregating data by region is often more informative in these cases.

Good luck!

Joachim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants