ISJohnny
ISJohnny

Reputation: 7

RStudio ggplot Logarithmic graph

I have a really easy data frame with two columns. We can just call them X and Y. Y is in feet and X is in cubic feet per second. I want to do a log graph and obtain the equation for the line but I have no idea how to accomplish this. I am guessing this is easier then I am making it out to be. I am currently using ggplot and I am getting really strange graphs. I attached a picture of what I am getting but the graph dows not make sense. It should be a straight line. graph

a %>% 
  ggplot(aes(Discharge, Gageheight)) +
  geom_point())

Thank you for your help!

Upvotes: 0

Views: 138

Answers (1)

Mattia Vinelli
Mattia Vinelli

Reputation: 11

I tried to use a really simple dataset like yours and using this:

ggplot(data = easy_dataset, mapping = aes(x, y)) +
    geom_point()

It gave me the expected graph.

Upvotes: 1

Related Questions