Skip to content

How to st numerical values to factors  #7

@yoditkebede

Description

@yoditkebede

Hi all,

Please refer to the attached document for figures.

Figure 1 :
image

I have been trying to make a boxplot using ggplot a graph representing the edge density in (y axis) per land cover type (x axis) for 3 different moments in time (fill=Year). After adding the data in r, I saw that year was appearing as a numerical variable, therefore I renamed it precising that it is a factor. But when plotting the graph this information is not taken into account, I should have something like Figure 2.

Figure 2:
image

Figure 3:
image
Numerical variable to factor in ggplot_issues.docx

I tried the same kind of graph but per District (so character variable) identified directly as a factor when reading the data, then it works. So what should I do to set the year variable as a factor more than I already did: renaming it by setting it as a factor.

An other thing, as you can see in the attached document figure 3: I get rid of the outliers of the boxplot by plotting them in white...which made them invisible on the white background but how can I do do that more properly...??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions