Please help me with this graph code

R programming language resources Forums Graphing Please help me with this graph code

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1059

    Hi, i need to make a graph with the change points of the daily paths of spider monkeys, for this i have found this code

    http://www.mcs.st-andrews.ac.uk/~pej/CPTauto_Rcode

    It works well until it gets to the last sentences

    text(z2bdiff, z1bdiff – 0.6*sd(bz1diff), paste(firstdiff,lastdiff,sep=”-“),col=”red”, cex = 0.7)

    Error en text.default(z2bdiff, z1bdiff – 0.6 * sd(bz1diff), paste(firstdiff, :
    zero-length ‘labels’ specified

    If i put a vector in the argument, labels = seq_along(x), r says to me that it have not found the coordinates.

    What is wrong with this code? How could i make it work?

    Thank you so much for your time and help,

    Carolina

    #1062
    bryan
    Participant

    Hi Carolina,

    Since the parameters for the text function in your code are specified by position, the piece that’s directly causing that error is this:

    paste(firstdiff,lastdiff,sep=”-”)

    Check that you have what you expect in the firstdiff and lastdiff objects.

    Bryan

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy