ggplot function error

So I have been trying to visualize my data using ggplot. I used the following command:

ggplot(data = inv_database, 
       mapping= aes(x = Gender,y = Total.Monthly.Income))+
  geom.point(size=5)+
  geom.line(colour="red")

The response I am getting;

Error in ggplot(data = inv_database, mapping = aes(x = Gender, y = Total.Monthly.Income)) : 
  could not find function "ggplot"

Prior to that I installed the following packages:

install.packages("rlang") 
install.packages("ggplot2", dependencies = TRUE)
install.packages("tidyverse", dependencies = TRUE)

Can someone please tell me what's going wrong here?

Either the installation process of ggplot2 has failed or you simply forgot to load the package in your current session with library(ggplot2)

Do you get any error message while loading the package?

I tried later with ggplot2. Same result.

Sorry but I don't understand what you mean, you are not providing any additional information to help us identify the cause of the problem. (like the output of running library(ggplot2)).

In short, if you get the exact same error message then the ggplot2 package is not loading in your session, maybe you haven't successfully installed it as you think.

I'm also very new to R and it's my first time here in this community.
Sharing what I thought might help.,

{r}
ggplot(data = inv_database) +
geom_point(mapping = aes(x = Gender,
y = Total.Monthly.Income)) +
geom.line(colour="red")
{r}

I don't know to use two geom in a single plot yet. But for scatter plot you can use the upto the two brackets and delete the rest from + , after the two brackets.

Try the command

library(ggplot2)

before anything else.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.