R: function to do go from data frame to an array with values
df2array
R Documentation
function to do go from data frame to an array with values
Description
The function transforms a float column in a data frame (from cHTS2df)
to an array.
Usage
df2array(df, what)
Arguments
df
Data frame (from cellHTS2df) with additional column weights.
what
which column contains the data, eg. value or residuals
Value
An array with the data from the data frame.
Author(s)
Elin Axelsson
Examples
data(screen1_raw)
df = cellHTS2df(screen1_raw,neutral = "Fluc")
df$weights = as.numeric(df$Type=="comb")
aa = df2array(df,what="value")
## see head for first replicate
head(aa[,,1])
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(coRNAi)
Loading required package: cellHTS2
Loading required package: RColorBrewer
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: genefilter
Loading required package: splots
Loading required package: vsn
Loading required package: hwriter
Loading required package: locfit
locfit 1.5-9.1 2013-03-22
Loading required package: grid
Loading required package: limma
Attaching package: 'limma'
The following object is masked from 'package:BiocGenerics':
plotMA
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/coRNAi/df2array.Rd_%03d_medium.png", width=480, height=480)
> ### Name: df2array
> ### Title: function to do go from data frame to an array with values
> ### Aliases: df2array
>
> ### ** Examples
>
>
> data(screen1_raw)
> df = cellHTS2df(screen1_raw,neutral = "Fluc")
> df$weights = as.numeric(df$Type=="comb")
>
> aa = df2array(df,what="value")
>
> ## see head for first replicate
>
> head(aa[,,1])
AnnIX CG12785 CG16935 CG3165 CG7889 CG8108 CSN3
AnnIX NA 202602224 197348704 237414096 193513824 228866352 136544176
CG12785 160767136 NA 154546992 206562624 170631744 198893168 111969952
CG16935 217506112 190307744 NA 213688848 226393104 262952080 131856088
CG3165 207328944 207880736 192834480 NA 214374976 254340704 122606880
CG7889 212157040 212620256 190127776 230509936 NA 230458544 144781088
CG8108 249977920 277760896 250713472 283969408 253689408 NA 177199856
CSN4 CSN5 Rbf Rho1 fwd pbl sos
AnnIX 131794672 129859192 255127456 461687616 182444080 390434656 107786432
CG12785 114559800 112578920 187875504 360135872 156260256 318554688 92239248
CG16935 128068480 123171064 254779648 414459776 183081072 456152672 102917752
CG3165 129057072 138740272 282572512 420147872 204826160 530530720 98733216
CG7889 145068352 127337112 243471296 415503072 188752960 311721312 115762152
CG8108 161336368 161686352 325552672 411669696 224883792 505019200 163648336
trbl zip
AnnIX 237842080 299332960
CG12785 191186944 233257408
CG16935 219330880 308145888
CG3165 232557872 318183584
CG7889 225115968 285345312
CG8108 285071104 297462464
>
>
>
>
>
>
> dev.off()
null device
1
>