How to print text output in r markdown - r-markdown

Does anyone know how to display text output into an R markdown file? I haven't seen any tutorial cover what I want to do, which is take input from a shiny app and use that for a for loop in my code which will create a text document, which is what I want to display. I don't want to write all of the code I have because it is quite long and isn't necessary, but can anybody at least point me in the write direction?

Related

R markdown show markdown output in .Rmd

I remember there was a time that when you type # in R markdown it will immediately transfer to the heading output. Also, when you type **bold** it will immediately show the text in bold. But now I can't find a way to do this.
Is it possible to show the markdown output in the .rmd document? Thanks!
This behaviour will depend on the text editor you use. Some Markdown editors have a "What You See Is What You Get" (or WYSIWYG) philosophy that will do exactly what you describe. You can find examples of WYSIWYG Markdown editors online, I personally have only tried Typora. But as far as I can tell, none of them seem to support Rmarkdown (perhaps someone has made an Rstudio add-in?).
On the other hand, in the early days of knitr, it used to support Lyx (I don't know if it still does), which is maybe closer to what you have in mind? See this post for an example: https://yihui.org/knitr/demo/lyx/

Is it possible to get the current line of the subtitle with libvlc?

I want to be able to get the current showing text of the subtitle, possibly as a string. Is this possible?
If possible it would also be nice to get all of the text from the subtitles, not only the current line.
If not possible, is there maybe a library that can do this? I want to be able to show a video, and have the subtitles as selectable text.
As a side note i am using C++ and Qt.
Thanks in advance.

Using Latex in a C++ Program

I want to write a program that allows me to type in plain text and LaTex code into a text field and displays in real time that text parsed with LaTex, essentially how the preview panel works in stackexchange. For example, as I'm typing this, $this code$ would be displayed in typeset format (if I was on mathexchange) in real type as I'd be typing this message. Is there a libarary I can use for C++ that would let me write a program like that? Where should I begin? Thanks for your time! (Oh, I also plan on developing this through QT).

Concerning Converting Text file to Binary File c++

I've been at it all night just trying to get a simple program to read in a text file and then copy it/write it back into a binary format.
My code looped through the text doc, got the data, put it in the buffer and wrote it back out. Heck I even hard coded the data I wanted to be written out in binary.
I used fstream, ofstream, example: fp1.open("student.dat",ios::binary);
and was reading up on several different sites such as:
http://www.functionx.com/cpp/articles/serialization.htm
http://www.cppforschool.com/tutorial/files2.html
and I had working code, but when I open the .bin file in my Notepad++ I saw that my text data still looked like text and wasn't really 'converted' over to any hexdecimal format, or anything really. Numbers were, and I double checked to see if they were accurate by y'know, a little website where you can type in the number and it spits out the hex.
I was so fed up as to why my text wasn't converting that I destroyed all my code and tried to start over. *hence the lack of examples"
So, my question, finally is, why wasn't the text changing in any way, is this normal for a binary file and using this method? I've even used pre-made coding examples and it all came out the same way. Am I just expecting it to all look like 1's and 0's and really it's not and it was all really working?
My main project is to convert an .OBJ file to binary data, but really how should I be looking at this? How should this binary file look?
Any advice would be greatly appreciated!!!
Thank you!
I was just using Chars and string and wasn't seeing a difference. Once I started using other data types, it became apparent that there was a change. I understand that .OBJ and .txt are binary file types, i just expected a bigger change. I used cplusplus.com and reviewed what I needed to know more of. Thank you for trying to help I guess!

How to create-edit-remove excel files?

i am doing a project that has some simple values(login,password,name,age). I was searching on the internet how to create an excel file on Visual C++, and i cant undestand it . I just want the simple way, i just want to see on my excel files 2 colums one having some login codes of my program and on the other the passwords. My programing level its not really high and im not an english speaker, so id like you guys to explain a bit or give me something simple.
Thanks for your time
If all you want is a simple file with 2 columns of data, I'd make a CSV (Comma Seperated Values) file, which can be opened in Excel, or any text editor. The CSV will look "nice" in Excel, as if it were an actual XLS file. Also, you won't be tied to Microsoft Office. This file can be written with simple string manipulations and file I/O.
The format would be :
Column1,Column2
data1,data2
data3,data4
However, and this is a big one... storing usernames and passwords in plain text is never a good idea.
Maybe there is some code from this web site that can help you out. It seems well documented and it was made for people to learn from it.
http://www.codeproject.com/Articles/15837/Accessing-Excel-Spreadsheets-via-C
Hope that helps!