0

I have a mixed database in excel which has a numeric and characters columns.

The final outcome should be various plots that describe our research question which is if there is any connection between district, job sector and more to uneployments percentage. I did a lot of searching and nothing comes up as far as it comes to characters columns. So, I need your help in understanding how can I make a conditional command to create a subset of this database which summarise it.

Here's how the database looks like:

     Cdata <-
  structure(
    list(
      Month = c(
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01",
        "2020-01"
      ),
      District = c(
        "Center",
        "Center",
        "Center",
        "Center",
        "Center",
        "Center",
        "Center",
        "Center",
        "Center",
        "Center"
      ),
      Age = c(
        "Under 17",
        "Under 17",
        "Under 17",
        "18-24",
        "18-24",
        "18-24",
        "18-24",
        "18-24",
        "18-24",
        "18-24"
      ),
      Gender = c(
        "Male",
        "Male",
        "Female",
        "Male",
        "Male",
        "Male",
        "Male",
        "Male",
        "Male",
        "Male"
      ),
      Education = c("0",
                    "0", "0", "0", "0", "0", "0", "0", "0", "0"),
      MedicalDisability = c(
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any",
        "Without any"
      ),
      Religion = c(
        "Jewish",
        "Muslims",
        "Other",
        "Jewish",
        "Jewish",
        "Jewish",
        "Jewish",
        "Jewish",
        "Jewish",
        "Jewish"
      ),
      UneploymentDays = c(
        "0-30",
        "Over 270",
        "Over 270",
        "0-30",
        "0-30",
        "0-30",
        "0-30",
        "0-30",
        "0-30",
        "31-180"
      ),
      Occupation = c(
        "Laboring class",
        "Sales \\ Costumer service",
        "Undefinded",
        "Laboring class",
        "Academic degree",
        "Practical engineers / Technicians",
        "Undefinded",
        "Sales \\ Costumer service",
        "Laboring class",
        "Practical engineers / Technicians"
      ),
      Jobseekers = c(2L,
                     1L, 1L, 1L, 1L, 1L, 1L, 2L, 5L, 2L),
      GMI = c(0L, 0L, 0L,
              0L, 0L, 0L, 0L, 0L, 0L, 0L),
      ACU = c(0L, 0L, 0L, 0L, 0L,
              0L, 0L, 0L, 0L, 0L),
      NACU = c(2L, 1L, 1L, 1L, 1L, 1L, 1L,
               2L, 5L, 2L),
      NewSeekers = c(0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L,
                     0L, 0L),
      NewFiredSeekers = c(0L, 0L, 0L, 0L, 0L, 1L, 0L,
                          0L, 0L, 0L)
    ),
    row.names = c(NA, 10L),
    class = "data.frame"
  )

i need a new dataset that looks like this:

District    Jobseekers  GMI     ACU     NACU
North       1024        8710    3245    3256
Center      57691       12160   8710    14320
South       21516       9821    5289    18172

And than sort it all over again by age:

Age       Jobseekers    GMI     ACU     NACU
Under 17  1024          8710    3245    3256
18-24     57691         12160   8710    14320
25-34     21516         9821    5289    18172
45-54     4682          7142    2365    6128
55-64     1999          1991    2839    1927
Over 64   10918         4289    1378    5368

And than, finally, i need to make plots for each category that shows statistics and make statistic tests as i described. Hope i made my point clearly now. as for the codes, i've tried so many structures and examples, non of them really helped. Let me make it clear - I don't want you to do my work or write the whole code for me, but at the same time i'll mentioned i'm a newbie in R language, and i do this task as a part of a project in data science course. If anything else needed, please let me know.

Here's a screenshot of the database: https://i.stack.imgur.com/fJHWN.jpg

Thanks, Moshe

Moshep
  • 19
  • 6
  • Welcome to Stack Overflow! It makes it easier for others to help is if you [edit] your question to provide (at least a subset of) your data by pasting the output of the R command `dput(head(your_df, n))`, where `your_df` is your data frame, and `n` is the number of rows of your data you want to share. However, I'll say that this question may be judged to be overly broad. It's close to questions just asking for a free code writing service, rather than having a specific issue. What have you tried so far? How did that fail? Making your Q more focused will increase the chance of a good answer – duckmayr Jun 07 '20 at 11:58
  • I'll try to help more with the information needed, but i didnt understood what exactly you need. I posted the database screenshot and the structure of the output table i need. can you explain what else you need please? later on, when i'll be near my cpu i'll post relevant codes – Moshep Jun 07 '20 at 15:17
  • With a screenshot of your data, we'd have to manually type up your data points to be able to work with them in our own R session. That seems unreasonable. If you instead [edit] your question to include the output of `dput()`, it gives us something we can just copy and paste to be able to work with your data. But, the larger problem is that your question isn't very focused. For example, you say "final outcome should be plots that describe **for instance**" (emphasis added). It sounds like you want an answerer to come up with your analysis for you. If you have specific outcomes you want, (1/2) – duckmayr Jun 07 '20 at 15:32
  • explain those exactly, as well as show what code you tried already to accomplish your result and describe either what error you received or how the output differed from your expected output. See [mcve] and [How to make a great R reproducible example](https://stackoverflow.com/q/5963269/8386140) for details. (/fin) – duckmayr Jun 07 '20 at 15:32
  • @duckmayr So i edited the original message. Hope it's ok as it is now and if anthing else needed please let me know. Thanks for your help! – Moshep Jun 08 '20 at 13:22

0 Answers0