I am writing my MSc in data analytics in the UK. I am planning to include some R code outputs in it: data and model summaries generated automatically (the grey part in the below example). Question: is the grey part a table, a figure or something else? I already have tables, properly formatted and numbered (also shown in the image below); but I also have figures (charts, etc.). My undergrad degree is not from the UK and was in humanities, so I'm looking for some advice as to how to label the code outputs. Thank you very much!
-
4Why do you want to include it as a code output, not as a proper table?– PetrJun 25 at 18:44
-
1What is the goal of this showing this output? Do you want to show how awesomely your R-code formats the output? (This could be the case if the thesis is about the program you designed) Or do you want to simply show the results? (This could be the case if your thesis is about the results you obtained from your model)– Chris_abcJun 25 at 23:41
-
The table above is just an example, in reality I have big contingency tables; and also model outputs (lists of >90 coefficients, etc.), I am writing my thesis in Word (because I find LaTex more trouble than it's worth and it is not a requirement to use it). I am trying to avoid having to format large tables by hand.– Reader 123Jun 26 at 19:44
4 Answers
Technically, that's a listing1, 2, 3.
But I'd never heard of that term before today, and I bet none of your thesis readers will have heard of it either. So the path of least resistance (in order to keep your numberings automated) is to label it a figure instead. If you're using Markdown, you could try something like:
```{lorem-ipsum.r}
cyberlorem cyberipsum
| dolor | sit | amet |
|-|-|-|
|consectetur| adipiscing | elit |
|sed | do | eiusmod |
```

-
2The term "Listing" is quite common in comp sci and I guess somewhat common in fields that sometimes deal with code, which I'd suspect data analytics to do. Jun 26 at 10:29
I'd argue that it is not necessary to include this in that exact visual form with gray background and monospace. Just set it properly as a table and refer to the data in the table.
If the exact visuals are important and relevant, and the fact that this is a screenshot of an actual interface is important for the text, then it should be a figure and labelled appropriately.
This is actually an intriguing question to which various answers can be given. I personally think it would depend on the use. If the main purpose is to give the readers numbers in a quick way, it would be a table. It looks a bit like a contingency table anyway. Chart is not really an option for me as I am using latex a lot. Figure would be used for an illustration or a graph, and that does not seem to be the case here. In a case like this, what your thesis advisor thinks is what decides what it is, anyway ;) .
-
Thank you very much, Thomas. You are probably right and I should ask my advisor. I accepted a different answer because technically that gave the name of the element, but I appreciate you taking the trouble to respond. Jun 26 at 19:54
The 'code output' would pass for either (table/figure) depending on the information being conveyed. Best bet as @Thomas-Schwarz has indicated is to seek advisor/supervisor advice.
From my Python lens, the code output would render like a table in markdown
. The dataframe can be plotted as chart in R or Python or any other: which can then be labelled as figure.