achetverikov / APAstats

R functions for formatting results in APA style and other stuff
20 stars 5 forks source link

Missing files in examples #8

Closed alapo closed 6 years ago

alapo commented 6 years ago

Quick and silly question but does anyone have access to the datasets that were used in the examples.md file. I'm trying to troubleshoot how some of the code works.

Thanks

achetverikov commented 6 years ago

data(faces) does not work for you?

if not, they are here https://github.com/achetverikov/APAstats/tree/master/apastats/data

alapo commented 6 years ago

Hi,

Thanks for such a quick reply. Once again I firmly believe it is something that I am doing wrong. But here's what I https://www.youtube.com/watch?v=wVG89hPlj24

IMAGE ALT TEXT HERE

achetverikov commented 6 years ago

Thanks for the detailed feedback. This example file was outdated, I've updated it.

achetverikov commented 6 years ago

hi @alapo, does it work for you now?

alapo commented 6 years ago

Thanks for the followup @achetverikov. It does work for the stats I want to run. But some of the examples are not running independently, there's a problem with plot.pointrange. Here's a video showing it.

IMAGE ALT TEXT HERE

alapo commented 6 years ago

I think the solution might be calling ggplot directly. Here's what I did that gets close.

data <- summarySEwithin(faces, measurevar="logAT", withinvars="user_gender",
                        idvar="uid", na.rm=FALSE, conf.interval=.95)
p1 <- ggplot(data, aes(x=user_gender, y=logAT, group=1)) +
    geom_line() +
    geom_errorbar(width=.1, aes(ymin=logAT-ci, ymax=logAT+ci)) +
    geom_point(shape=21, size=3, fill="white")
p1

But this does work with the geom_bar.

datac <- summarySEwithin(faces[correct==1, ], measurevar="logAT", withinvars=c("stim_gender","user_gender"), idvar="uid")
datac

p1 <- ggplot(datac, aes(x=user_gender, y=logAT, fill=stim_gender)) +
    geom_bar(position=position_dodge(.9), colour="black", stat="identity") +
    geom_errorbar(position=position_dodge(.9), width=.25, aes(ymin=logAT-ci, ymax=logAT+ci)) +
    scale_fill_manual(values=c("#CCCCCC","#FFFFFF")) +
    scale_y_continuous(breaks=seq(1:100)) +
    theme_bw()
p1

Image of geom_bar

achetverikov commented 6 years ago

I'm not really sure what creates the error. I've just tested it again - seem to work fine for me. A couple of thoughts: 1) did you install the updated version of apastats before trying the examples again? 2) did you try to run chunks one by one? Getting the exact line in that chunk that creates the error would be helpful.

achetverikov commented 6 years ago

And sure, you can do the same with summarySEwithin and ggplot, plot.pointrange is just a wraparound with some bells and whistles

alapo commented 6 years ago

Thanks for the followup @achetverikov. Thanks for taking a look. I did as you suggested. First I uninstalled apastats and then I reinstalled it. Here's a video showing my whole process.

IMAGE ALT TEXT HERE

Please let me know if this is helpful in anyway.

achetverikov commented 6 years ago

Hi @alapo ! Sorry for a long delay, it seems that the error was brought by a conflict due to changes in the updated version of plyr/ggplot2. I started getting it when I reinstalled R. Should be fixed by the latest commit.

achetverikov commented 6 years ago

I'm closing this, as I think it was fixed in August. If you still have this problem, please let me know.