[R] log transform a data frame
Ana Marija
@okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Tue Jun 13 23:07:46 CEST 2023
Hello,
I have a data frame like this:
d11=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv",
stringsAsFactors=FALSE, header=TRUE))
> d11
X Domain.decomp. DD.com..load Neighbor.search Launch.PP.GPU.ops.
Comm..coord.
1 SYCL 2. 1 0 3.7 0. 1
1 .6
2 CUDA 2 0 3. 1 0
1 .0
Force Wait...Comm..F PIE.mesh Wait.Bonded.GPU wait.GPU.NB.nonloc.
1 1 . 5 1 .3 65.6 0 0
2 1 .2 1 .7 70.9 0 0
Wait.GPU.NB.local NB.X.F.buffer.ops. Write.traje Update Constraints
Comm..energies
1 0 7.3 0.3 6.3 8.9
0.9
2 0 4.4 0.3 4.3 9.7
0.9
PIE.redist..X.F PIE.spread PIE.gather PIE.3D.FFT PIE.3D.FFT.comm.
PIE.solve.Elec
1 8. 1 29.7 19.9 6.0 1 .2
0.7
2 8.7 30.6 21 .3 8.6 1 .0
0.5
I am trying to log transform the whole data frame, but I get this error:
> d1=log(d11)
Error in Math.data.frame(d11) :
non-numeric variable(s) in data frame: X, Domain.decomp.,
Neighbor.search, Launch.PP.GPU.ops., Comm..coord., Force, Wait...Comm..F,
PIE.redist..X.F, PIE.gather, PIE.3D.FFT.comm
My goal is to make a stacked barplot like this:
d2=as.matrix(sapply(d1, as.numeric))
b<-barplot(d2, legend= rownames(data2), beside=
TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8",
"#6a51a3"))
If I don't log transform my code runs.
Please advise,
Ana
[[alternative HTML version deleted]]
More information about the R-help
mailing list