cbail / textnets

R package to perform automated text analysis using network techniques
MIT License
211 stars 62 forks source link

Add warning or default for PrepText node_type #4

Closed fmerhout closed 6 years ago

fmerhout commented 6 years ago

Currently, PrepText does run even if node_type is not specified, producing this warning:

   Warning messages:
   1: In if (node_type == "groups") { :
     the condition has length > 1 and only the first element will be used
   2: In if (node_type == "words") { :
     the condition has length > 1 and only the first element will be used

It would be more useful for these cases to (1) either break the function and have an informative warning like "node_type needs to be specified" or (2) alternatively set a default.

fmerhout commented 6 years ago

This is addressed in: https://github.com/cbail/textnets/commit/f2dd6f4c93b52ee148f61a5199af93f8e20671f8