16

Does anyone have an actual approach on how to create UML diagrams directly from R code?

This is pretty much the only resource that I found in that regard. Works, but not really "integrated" in the sense that the required info for the diagrams are automatically detected in the actual code in any sort.

Related to this question.

Community
  • 1
  • 1
Rappster
  • 12,762
  • 7
  • 71
  • 120
  • You should know that this kind of question is plain off-topic for SO. – qwerty_so Jul 13 '16 at 09:12
  • Why is that? It's about how to programatically realize the creation of UML diagrams or the like. So it's coding related – Rappster Jul 13 '16 at 09:15
  • http://stackoverflow.com/help/on-topic 4. in the list – qwerty_so Jul 13 '16 at 09:21
  • 2
    Okay, I took out the "asking for an opinion" question. But the one regarding UML (which is a standard, not a tool) is valid, IMO. – Rappster Jul 13 '16 at 09:33
  • 1
    I don't think so. "Are there any" is a "have you others used Google more effectively than I"-question. Sometimes you're lucky and get through with such kind of questions. But only sometimes... – qwerty_so Jul 13 '16 at 09:39
  • 2
    Well, sharing packages/package names is far from being uncommon when asking for a solution to a problem. But if it's the actual words that throw you off: here you go ;-) I'd appreciate taking the vote to close the question back, then. – Rappster Jul 13 '16 at 09:41
  • 1
    I'm pretty sure that there's nothing out there to do what you're asking for. Though R has a big community, it's not that attractive for UML tool developers to compile it to UML. I mean, even Objective-C has no UML compiler (and will likely never get one; so maybe Swift some day). And that's used by the whole Apple developer scene. I just know R by it's name and what it's meant for. So no idea if you could cross-compile it to some Cxx or Pythonic language. – qwerty_so Jul 13 '16 at 09:52

1 Answers1

6

What do you mean by "required info for the diagrams are automatically detected in the actual code"? PlantUML in its current state (Link) is actually quite nice to easily create simple UML charts in R logic.

Take this example:

library(plantuml)
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x = x
# vector = TRUE
  )

will plot as

enter image description here

Maybe check it out?

Roman
  • 4,744
  • 2
  • 16
  • 58
  • Thanks, I'll have a look at it. What I meant by "directly from the code" is, e.g., a way to create diagrams directly from the actual definition of an R6 class. – Rappster Oct 18 '18 at 08:34