I unsuccessfully searched for a way to hold axes, designated in a certain way, after creating a linear model graph.
My details
Sample ActB
Pre-Amp_Ctrl cDNA 5.607907144
Pre-Amp_Ctrl cDNA 10e-1 8.916634343
Pre-Amp_Ctrl cDNA 10e-2 12.6501345
Pre-Amp_Ctrl cDNA 10e-3 16.32385192
Pre-Amp_Ctrl cDNA 10e-4 20.30327678
Pre-Amp_Ctrl cDNA 10e-5 23.40471201
When i do it ok
ggplot(NP, aes(x=NP$Sample, y=NP$actbct)) +
geom_point()
I get this:

where samples are labeled with ticks.
However, when I try to add a trend line, I need to change the factor vector to "as.numeric" and I will lose the marked ticks.
ggplot(NP, aes(x=as.numeric(NP$Sample), y=NP$actbct)) +
geom_point() +
geom_smooth(method= "lm", color = "red")
and get this image:

Is there any possible way to keep the patterns tagged as well as have a trend line? I know I can do it in Excel, but it would be great to do it in R too.
source
share