csgillespie / poweRlaw

This package implements both the discrete and continuous maximum likelihood estimators for fitting the power-law distribution to data. Additionally, a goodness-of-fit based approach is used to estimate the lower cutoff for the scaling region.
109 stars 24 forks source link

running "plot" in Rmd files with cache = TRUE #41

Closed LaurentFranckx closed 9 years ago

LaurentFranckx commented 9 years ago

Hi, It seems like a have another issue with plot() now. I am running some functions in R chunks in an RMd file, and I get an error: ploterrorinrmd I think this is linked to the fact the the previous chunk was run with cache= TRUE, because I did not have a problem when cache=FALSE. When I comment out the following lines:

plot(FreqPow)
lines(FreqPow)

then the other lines in the same chunk work perfectly:

summary(FreqPow$internal)
df <- cbind(FreqPow$internal$freq,FreqPow$internal$values)
head(df)
tail(df)
head(TestFreqTable)
tail(TestFreqTable)
csgillespie commented 9 years ago

I have the same problem when building vignettes. This is more to do with knitr than this package. Perhaps more granular caches (http://yihui.name/knitr/demo/cache/) would help.