How can I print string and variable contents on the same line using R

0 votes
May 9, 2018 in Data Analytics by shams
• 3,670 points
1,892 views

1 answer to this question.

0 votes

There are two options for doing so. 

  • You can use paste with print: print(paste0("word document: ", wd))
  • You can use cat: cat("word document: ", wd)

In both the above cases you will get the string as well as your variable content.

 

answered May 9, 2018 by zombie
• 3,790 points

Related Questions In Data Analytics

0 votes
1 answer

How can I figure out if an R program was executed from the command line?

Try this code: if (interactive()) { print('Hello ...READ MORE

answered Jun 28, 2019 in Data Analytics by Zulaikha
• 910 points
668 views
+1 vote
2 answers

Which function can I use to clear the console in R and RStudio ?

Description                   Windows & Linux           Mac Clear console                      Ctrl+L ...READ MORE

answered Apr 17, 2018 in Data Analytics by anonymous
82,929 views
0 votes
1 answer

How can I control the size of points in an R scatterplot?

plot(variable, type='o' , pch=5, cex=.3) The pch argument ...READ MORE

answered May 3, 2018 in Data Analytics by shams
• 3,670 points
1,290 views
0 votes
1 answer

What is a Random Walk model and how can you simulate it using R?

A random walk is a simple example ...READ MORE

answered Jul 3, 2018 in Data Analytics by DataKing99
• 8,250 points
3,247 views
0 votes
1 answer

How can I import a file in R without giving the destination/file path to the specified file?

You can use the window explorer to ...READ MORE

answered Aug 28, 2018 in Data Analytics by Abhi
• 3,720 points

edited Aug 28, 2018 by Vardhan 3,043 views
0 votes
1 answer

How can I convert a factor variable to numeric in R ?

A factor variable can be converted to ...READ MORE

answered Sep 19, 2018 in Data Analytics by shams
• 3,670 points
3,845 views
+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer

How can I increase the number of axis ticks in R ?

You can try to override ggplots default ...READ MORE

answered May 30, 2018 in Data Analytics by zombie
• 3,790 points
6,758 views
0 votes
1 answer

How can I list all the data sets available in all R packages?

You can use the below line of ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,790 points
1,027 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP