-1
I need to plot a graph from a file’s data. txt, the data import part is ok, however, when I use the ggplot function, it says that could not find "ggplot". Below is the code I’m trying to use:
require("ggdata")
library(haven)
library(readxl)
library(ggplot2)
library(ggalt)
dados <- read.csv(file = "C:/Users/gabri/OneDrive/Documentos/Amostra03.txt", sep = "")
model <- lm(x~y,dados)
ggplot(dados,aes(x=x,y=y)) geom_point()
I had already managed to fix this mistake, however I lost the code by carelessness and do not remember the procedure I did.
Gabriel, good morning! As Voce did not give many details, what I can observe that this wrong is the lack of
+between ggplot and geom_point. Correct would be:ggplot(dados,aes(x=x,y=y)) + geom_point().– lmonferrari
Without the
dadosthe example is not reproducible. It is not necessary to load as many packages and thelmis completely unnecessary. Good questions must have data and code minimum to reproduce the problem.– Rui Barradas