Lumenize icon indicating copy to clipboard operation
Lumenize copied to clipboard

R function read.DIF() and read.table()

Open jmaccherone opened this issue 12 years ago • 2 comments

Used to import data. read.DIF() for Windows machines, read.table() for Macs. Can use with clipboard and assign to data frame as a way to import. variableName <- read.DIF("clipboard", transpose=TRUE) variableName <- read.table(pipe("pbpaste"))

jmaccherone avatar May 09 '13 18:05 jmaccherone

We need some way to import data from files. We'll also need ways to import from http GET but we'll do that under a different issue.

lmaccherone avatar Jun 16 '13 23:06 lmaccherone

If the file is a csv file then we should import into an Array of Maps (look at the "table" for the book assignment).

So, if the user specifies $myTable = read.table('mydata.csv') and mydata.csv contains:

"column1", "column2", "column3"
1, "my name", true
10, "another name", false

Then we want it to come in as an Array of Maps

$myTable = [
  {column1: 1, column2: "my name", column3: true},
  {column1: 10, column2: "another name", column3: false}
]

Let's use node module csv.

lmaccherone avatar Jun 17 '13 00:06 lmaccherone