Ggplot2 package is not showing post installation and library("ggplot2") and not even under tidyverse package

getting the below error while executing the ggplot2 script

ggplot(loandefcomplete, aes(x=status, y=account_id)) + geom_point(colors("navy"))+ xlab("status")+ylab("accounts") + ggtitle("account vs loan status")

Error in if (distinct) c[!duplicated(t(col2rgb(c)))] else c :
argument is not interpretable as logical

When loading packages you can't put the package name in quotes. Try these instead:

library(tidyverse)
library(ggplot2)

tried that also but its not working even no error threw

Are you sure that the packages were installed correctly?

Actually, you can. It's only due to R's (quirky) non-standard evaluation that the quotes may be omitted.

2 Likes

Weird! I always thought it had to be quote-less.

:100:% sure...got successful installation message at the end...but failed to see in library

Can anyone help me? I'm stuck with this

Can you copy and paste the output you get when you run this line?

find.package("ggplot2")
find.package("tidyverse")
.libPaths()

Thanks now its working

getting error while running the below command -
visual1 <- ggplot(loandef, aes(x=status, y=account_id)) + geom_point(colors("navy")+ xlab("status")+ylab("accounts")) + ggtitle("account vs loan status"))

Error: unexpected ')' in "visual1 <- ggplot(loandef, aes(x=status, y=account_id)) + geom_point(size = 2.5, colors("navy")+ xlab("status")+ylab("accounts")) + ggtitle("account vs loan status"))"

Your closing parenthesis to your geom_point function is in the wrong place.

Try this:

visual1 <- ggplot(loandef, aes(x=status, y=account_id)) + 
  geom_point(color = "navy")+ 
  xlab("status")+
  ylab("accounts") +
  ggtitle("account vs loan status") 
3 Likes

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

2 Likes