Commit 64dd334f authored by majpark21's avatar majpark21
Browse files

auxfun: plot of PSD

parent afbab618
......@@ -683,6 +683,22 @@ LOCplotTrajRibbon = function(dt.arg, # input data table
# Plot average power spectrum density per facet
LOCplotPSD <- function(dt.arg, # input data table
x.arg, # string with column name for x-axis
y.arg, # string with column name for y-axis
group.arg=NULL, # string with column name for grouping time series (here, it's a column corresponding to grouping by condition)
xlab.arg = x.arg,
ylab.arg = y.arg){
if(length(setdiff(c(x.arg, y.arg, group.arg), colnames(dt.arg))) > 0){
stop(paste("Missing columns in dt.arg: ", setdiff(c(x.arg, y.arg, group.arg), colnames(dt.arg))))
p.tmp <- ggplot(dt.arg, aes_string(x=x.arg, y=y.arg)) +
geom_line() +
facet_wrap(group.arg) +
labs(x = xlab.arg, y = ylab.arg)
# Plots a scatter plot with marginal histograms
# Points are connected by a line (grouping by cellID)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment