read.so: Read displayed text at Stack Overflow

Description Usage Arguments Details Author(s) See Also Examples

Description

For many questions at Stack Overflow, the question asker does not properly share their question (for example, using dput or by sharing some commands to make up the data). Most of the time, you can just copy and paste the text into R using read.table(text = "clipboard", header = TRUE, stringsAsFactors = FALSE). This function is basically a convenience function for the above.

Usage

1
  read.so(sep = "", header = TRUE, out = "mydf")

Arguments

sep

Most of the time, the code shared is space separated (which is the default for this function). If the separator is any other character, it can be specified here.

header

Are headers included?

out

Desired output object name. Defaults to mydf.

Details

The output of read.so is automatically assigned to an object in your workspace called "mydf" unless specified using the out argument.

Author(s)

Ananda Mahto

See Also

dput, read.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
## Copy the following text (select and ctrl-c)

# A B
# 1 2
# 3 4
# 5 6

## Now, just type:

read.so()

## End(Not run)

mrdwab/AMsnippets documentation built on May 23, 2019, 7:15 a.m.