Error in parse: <text>:2.0: unexpected end of input

Dear,
I experienced the error in parse: :2.0: unexpected end of input, when I use the following coding:

output$cloneCorrectOutput <- renderTable({

dataset <- datasetInput()
pop.structure <- input$clonecorrectionAnalysis
dataset <- clonecorrect(dataset, strata = as.formula(paste0(pop.structure)))
aa <-  poppr(dataset)

})

The error is as following:
Advarsel: Error in parse: :2:0: unexpected end of input
1: ~
^
102: parse
99: formula.character
97: as.formula
96: renderTable [D:\Work04\SVNShinywc\ssrDataPoppr/server.R#531]
95: func
82: origRenderFunc
81: output$cloneCorrectOutput
1: shiny::runApp

Is there anyone can help with this? I already update Rstudio to the new version 1.2.5033

Thank you.

Best regards
Ying

You should check the content of paste0(pop.structure) to verify it is a single string that can be converted to a formula. Does it have a tilde in it?

Dear,
Thanks for your reply.
The coding change to:
dataset <- clonecorrect(dataset, strata = as.formula(paste0('~',pop.structure)))
but the problem is still there.
Is there any solution to it?

if you handwrote the formula expression, would it work ?
(sidenote: I have no expertise in the clonecorrect functionality)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.