exportBed: Exporting a Bed File.

Description Usage Arguments Details Value Author(s) Examples

View source: R/exportBed.R

Description

This function exports a standard bed file.

Usage

1
exportBed(x, file = NULL, header = FALSE)

Arguments

x

data.frame

file

Character, specifies filename/path

header

Logical, shall a header be written

Details

This function exports a data.frame to a standard bed file. If no file name is given, the variable name will be used instead.

Value

A bed file

Author(s)

Daniel Fischer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
novelBed <- data.frame(Chr=c(11,18,3),
                      Start=c(72554673, 62550696, 18148822),
                      End=c(72555273, 62551296, 18149422),
                      Gene=c("LOC1", "LOC2", "LOC3"))

# Create a temporary file to where the output of the function is stored
myfile <- file.path(tempdir(), "myLocs.bed")

exportBed(novelBed, file=myfile)
exportBed(novelBed, file=myfile, header=TRUE)

GenomicTools.fileHandler documentation built on March 26, 2020, 7:23 p.m.