[R] Change colour of line in logi.hist.plot
David Winsemius
dwinsemius at comcast.net
Sun Nov 5 18:17:17 CET 2017
> On Nov 5, 2017, at 6:03 AM, Göran Bergqvist <Goran.Bergqvist at jagareforbundet.se> wrote:
>
> I am using the function logi.hist.plot in package popbio. I want to change the colour of the probability line from the default red to black. I have not been able to find out how to do that.
If you look at the code for that function you see this line:
logi.curve <- function(independ, depend, mod = logi.mod,
col.cur = "red", lwd.cur = 4) {
Since it's the only occurence of "red" that's probably where "the money lies". You can either do a "hard hack" where you alter the value of the parameters to that inner function,
... or you can add a named parameter after the dots in the outer parameter list such as:
function (independ, depend, logi.mod = 1, type = "dit", boxp = TRUE,
rug = FALSE, ylabel = "Probability", ylabel2 = "Frequency",
xlabel = "", mainlabel = "", las.h = 1, counts = FALSE, ..., col.cur = "red")
... and modify the inner function to read:
logi.curve <- function(independ, depend, mod = logi.mod,
col.cur = col.cur, lwd.cur = 4) {
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius
Alameda, CA, USA
'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
More information about the R-help
mailing list