j2142
1
Hello! I'm very new to R and can't figure out a problem of assigning a creating a new variable that takes the natural log of its original.
ggplot(data=Crime, aes(x=MHI))+
geom_histogram()+
theme_minimal()
I'd like to take the log of the x variable and assign it as a new variable, logMHI.
I've tried a few different things, none seem to work.
Thanks so much!
startz
2
Crime$logMHI <- log(Crime$MHI)
is one way to do it.
1 Like
system
Closed
3
This topic was automatically closed 42 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.