Output specific data inside a table

Hey all!
So, I'm trying to make a simple script in which the output would be a string of combined text and data within an excel table, however, im having trouble finding the correct formula to call the specific value i want to print inside that table.
An example:
If the table looks like this:
................... Price . . . Volume . Pct. Change
Dow Jones. 34.000 . . 470.000 . . 0,45%
Nasdaq ...... 13.500 . . 900.000 . . -0,74%
S&P ............ 4.000 .. .. 230.000 . . 0,03%

I'm looking for the script that would give me an output similar to this:

'Nasdaq falls by -0,75% on todays session, closing at a price of 13.500 and a volume of 900.000'

I have a feeling this should be a fairly easy script, but my knowledge of R is limited and this would help me greatly.
Also, is there a way to make an if statement so that if the number in Pct. Change is a negative number, the output is 'falls' and, if instead, it's positive, the output is 'rises'?

Thank you so much in advance!Preformatted text

You can use the glue package to accomplish that

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.