Search code examples
rnlpstanford-nlpstanford-nlp-server

R: coreNLP - cannot plot getdependency


I have a short text data:

"I always prefer old-school guy. I have a PhD degree in science. I am really not interested in finding someone with the same background, otherwise life is gonna be boring."

I have used the following codes to get the dependence structure of the text above.

dep <- getDependency(anno)

but when I tried to plot the sentence structure as suggested in book - Humanities Data in R:

plot(anno,3)

It should give me the sturcture of the third sentence, but I get is an error message:

 Error in xy.coords(x, y, xlabel, ylabel, log) : 
'x' and 'y' lengths differ

I am wondering how can this be properly plotted and get a plot like the following.

enter image description here


Solution

  • My guess is that you have not loaded the plot function for this kind of object. It appears that the message is coming from the default plot function.