Watts-College / cpp-528-fall-2021

https://watts-college.github.io/cpp-528-fall-2021/
2 stars 2 forks source link

jplot() Error #24

Open ekmcintyre opened 2 years ago

ekmcintyre commented 2 years ago

I keep getting an error when trying to use the jplot function to make histograms of MHV.

Error in jplot(df$v90, df$v00, lab1 = "MHV in 1990", lab2 = "MHV in 2000", : could not find function "jplot"

Every time I search Google or Help in R I get results about ggplot2, but no actual jplot() function. I removed and reinstalled ggplot2 in case there was an issue with the package, but the error still shows. Is there another function I am meant to use there? I copied the code directly from the lab instructions and only changed variable names and datasets for 1990 and 2000 instead of 2000 and 2010.

jplot( df$v90, df$v00, lab1="MHV in 1990", lab2="MHV in 2000", xlim=c(0,1000), ylim=c(0,1000), axes=F )

castower commented 2 years ago

Hello @ekmcintyre,

Jplot() is an alternative to ggplot() that has a specific format for journals.

You can try ggplot2::jplot() or changing the function to ggplot()

ekmcintyre commented 2 years ago

I get this error when trying ggplot2::jplot()

Error: 'jplot' is not an exported object from 'namespace:ggplot2'

ekmcintyre commented 2 years ago

If I try ggplot() I get this error.

Error: Mapping should be created with aes() or aes_().

castower commented 2 years ago

Hello @ekmcintyre

can you send me your .RMD file? I'll take a look.

I have also extended the due date to Saturday to allow more time to troubleshoot this error.