fileseq: calculate file sequence

Description Usage Arguments Value See Also Examples

Description

The classic fileseq End of record loading. This function will create a vector that will identify the row number or file sequence id (as per . By setting creating this, you can always revert to the original order of your data set

Usage

1
2
3
4
5
6
7
8
9
  fileseq(data, fileseq.name, safe)

  ## S3 method for class 'data.frame'
 fileseq(data,
    fileseq.name = "fileseq", safe = TRUE)

  ## S3 method for class 'data.table'
 fileseq(data,
    fileseq.name = "fileseq", safe = TRUE)

Arguments

data

a data.frame or data.table

fileseq

character string of length 1 which will be the name of the created column

safe

logical Check whether file.seq-named column exists prior to overwriting.

Value

a data.frame updated with column file.seq or the data.table with fileseq added by reference.

See Also

morbseq

Examples

1
2
3
4
5
6
7
DF <- data.frame(ppn = c(1L,1L,2L), var1 = seq_len(3))
DT <- data.table(DF)
fileseq(DF)
fileseq(DT)
fileseq(DT)
# gives error as fileseq has been assigned by reference
fileseq(DT, safe = FALSE)

mnel/linkedEpi documentation built on May 23, 2019, 5:06 a.m.