Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.graph.script interprets '#' characters in hex colour codes as commented lines #7

Open
Lachlan00 opened this issue Nov 10, 2020 · 1 comment

Comments

@Lachlan00
Copy link

Applying data.graph.script() will strip all comments but also strips lines with '#' inside strings such as used in hexadecimal color codes (e.g '#ededed'). Consequently, the code will run into syntax errors.

Example:

  p <- ggplot(data, aes(x=site, y=value)) +
    geom_boxplot(outlier.alpha=.5, fill='#ededed') +
    # add threshold lines
    geom_hline(aes(yintercept=y), data=lines, linetype='dashed', 
               color='#d93d11', size=.3) +
    labs(x=NULL, y=longname.clim.ylab(var, thresh)) +
    ggtitle(title) +
    theme_classic() +
    ggthemes.custom('theme_border') +
    theme(axis.text.y.right = element_text(color = "#d93d11", face='bold', size=12),
          axis.ticks.y.right = element_blank())

Becomes:

 p <- ggplot(data, aes(x=site, y=value)) +
   geom_boxplot(outlier.alpha=.5, fill='
   
   geom_hline(aes(yintercept=y), data=lines, linetype='dashed', 
              color='
   labs(x=NULL, y=longname.clim.ylab(var, thresh)) +
   ggtitle(title) +
   theme_classic() +
   ggthemes.custom('theme_border') +
   theme(axis.text.y.right = element_text(color = "
         axis.ticks.y.right = element_blank())

In the temp.file.dep.graph.R file.

@Lachlan00
Copy link
Author

Lachlan00 commented Nov 10, 2020

I think the issue occurs inside script.like.fun(path, path.temp) during the read in process read.table(path, sep = "\n", quote = "")$V1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant