8

I have a vector I'd like to copy paste into code to be able to produce a minimal working example.

Problem is, when I try to print the vector it produces output like

> head(residuals_list)
            1         2         3         4         5         6
    0.1833777 7.1833777 1.1833777 4.1833777 5.1833777 0.1833777

How do I get r to print c(0.1833777, 7.1833777, ...)?

The Unfun Cat
  • 26,783
  • 25
  • 102
  • 145

2 Answers2

26

With dput :

x =runif(5)
dput(x)

c(0.634340619435534, 0.833359521813691, 0.4804580679629, 0.119585362030193, 
0.379494784167036)
Victorp
  • 12,926
  • 1
  • 46
  • 54
0

Try str(residuals_list) to get a string version of the object

sharoz
  • 5,953
  • 7
  • 30
  • 54