I am really new at this and I hope you could help me.
I am trying to represent in a a4 papper (Pageorientation: Landscape) two plots against two tables. In this case I am using the same table (from a .dat file) to simplify the example.
I started to read the file:
dat<-read.table("d:\\Users\\...\\xxxxxxxx.dat",header=TRUE,sep="\t")
Now I want to divide my a4papper in 4 (2X2):
par(mfrow=c(2,2))
Now I define my vectos and represent them:
v<- c(1,2,3,4,5,6,7,8,9,10)
z<- c(2,4,6,8,10,12,14,16,18,20)
w<- c(1,7,17,18,35,55,98,100)
q<- c(2,4,5,6,7,50,67,99)
plot(v,z)
plot(w,q)
Now I represent my data.frame in a table (X2) (with grid):
grid.table(dat, gpar.coretext = gpar(fontsize=6), gpar.coltext = gpar(fontsize=6), padding.h=unit(2, "mm"), padding.v=unit(2, "mm"), show.rownames = F)
grid.table(dat, gpar.coretext = gpar(fontsize=6), gpar.coltext = gpar(fontsize=6), padding.h=unit(2, "mm"), padding.v=unit(2, "mm"), show.rownames = F)
RGui represents me: the two plots (in their respective positions in (1,1) and (1,2)) and the table centered.
After doing some research I found out that grid.table uses grid graphics, a system that is mostly incompatible with base graphics. I think I should use Gridbase, lattice or ggplot2 and then combine it with gridarrangement (I don't understant why, beacause we already define that we want a 2X2 matrix so our table should adapt itself to his space).
BUT:
1) Looking into Gridbase and Lattice package I didn't found any function that allows me to represent my data.frame in a tabular/table with grid properly like grid.table().
2) When I try to run my ggplot2:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘munsell’ Error: package or namespace load failed for ‘ggplot2’
If somebody could help me with the code I would be really apreciated
Best regards