formatR icon indicating copy to clipboard operation
formatR copied to clipboard

consider just reserve comments in incomplete expression?

Open bioinformatist opened this issue 5 years ago • 1 comments

Hi Yihui,

I have code snippet as this:

cc <- vapply(names(platforms),
                 function(x) list(suppressMessages(ConsensusClusterPlus::ConsensusClusterPlus(platforms[[x]][gene.sig,],
                                                                                              maxK = max.K, reps=rep.runs, pItem=pItem,
                                                                                              pFeature=pFeature, title=run.dir[x],
                                                                                              clusterAlg=clusterAlg, distance=distance,
                                                                                              seed=cc.seed, plot = NULL))),
                 # ConsensusClusterPlus returns a list of 7 elements, but we need a nested list
                 list(rep(list('aString'), 7)))

When I try tidy this file, something goes wrong:

Error in base::parse(text = code, keep.source = FALSE) : 
  <text>:48:1: unexpected 'function'
47: invisible(".BeGiN_TiDy_IdEnTiFiEr_HaHaHa# Must use <<- here for scope restrinction.HaHaHa_EnD_TiDy_IdEnTiFiEr")
48: function
    ^

Well, I have read the documents and I know that it can be confusing. But sometimes peoples need these comments in-place to remind contributors (often himself) what this part of code DOES do. Could you consider just reserve these comments (or add a parameter for this aim)? You can assign this feature to me. It's my honor.

bioinformatist avatar Jun 24 '19 10:06 bioinformatist

It is too hard for me. If you can figure out how, I'll be happy to review your request. Thanks!

yihui avatar Jun 24 '19 15:06 yihui