I have a function that counts the size of the library and plots the histograms.
The function looks like this
plotLibrarySize <- function(t, cutoffPoint) {
options(repr.plot.width=4, repr.plot.height=4)
hist(
t$total_counts,
breaks = 100
)
abline(v = cutoffPoint, col = "red")
}
I have a list of objects in my environment from t_1 to t_n that I loop over to get the size of the files.
for (i in 1:length(paths))
print(sum(get(t[i])$total_counts))
now to plot it normally I would be using
plotLibrarySize(t_1,2500)
However, as I have many objects I am using loop
for (i in 1:5)
plotLibrarySize(get(t[i]), 2500)
This generates no plots or throws error. Bit confusing.
get? Tryfor (i in 1:5) plotLibrarySize(t[i], 2500)