# Ds.table error in parse

**URL:** <https://datashield.discourse.group/t/ds-table-error-in-parse/594>\
**Category:** Beginner Support\
**Created:** [2 August 2022 12:49 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594 "2022-08-02T12:49:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![makal](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@makal](https://datashield.discourse.group/u/makal)\
**Post date:** [2 August 2022 12:49 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/1 "2022-08-02T12:49:03Z")

</div>

Hi, I try to create 2d contingency table with ds.table from dsBaseClient and it throws me error in parse:

```auto
` Aggregated (tableDS(rvar.transmit = "D$var1", cvar.transmit = "D$var2", ) [==========] 100% / 1s

 Data in all studies were valid 

Study 1 : No errors reported from this study

Error in parse(text = output.text.props.counts.dim.2) : 
  <text>:1:47: unexpected input
1: output.list=list(TABLE.STUDY.server2_`

```

Ive checked it on [opal-demo.obiba.org](http://opal-demo.obiba.org) and on that server it works fine, so my suspicions are related to the original data. I have integers in those two variables with some empty cells/values. Does somebody encountered similar error, or has any idea how to deal with it. The error response is not clear enough for me. dsBaseClient\_6.2.0 DSOpal\_1.3.0 DSI\_1.4.0

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [2 August 2022 13:21 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/2 "2022-08-02T13:21:17Z")

</div>

Makal,

my initial impression is you have found a bug (on line 1454 of ds.table.R: the text of the remote invocation appears to be malformed). I will see if I can identify a work-around.

Stuart

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [2 August 2022 13:36 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/3 "2022-08-02T13:36:20Z")

</div>

Makal, Please could you send the text of the original call to ds.table(…) so we can create an accurate test for this situation.

Stuart

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [2 August 2022 15:52 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/4 "2022-08-02T15:52:07Z")

</div>

Makal, could try using ds.table2D as a work-around. The issue appears to be more subtle that I originally thought, does any of the variable you are specifying contain unusual characters?

Stuart

---

<div class="post-metadata">

**Author:** ![makal](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@makal](https://datashield.discourse.group/u/makal)\
**Post date:** [4 August 2022 08:53 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/5 "2022-08-04T08:53:02Z")

</div>

Thanks for your reply Stuart The call is

```auto
builder$append(server = "xxx", url = "yyy", user = "xxx", password = "yyy", driver = "OpalDriver", options='list(ssl_verifyhost=0, ssl_verifypeer=0)', table = "xxx.yyy")
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")
ds.table('D$var1','D$var2')

```

Variables in those 2 ‘columns’ are integers from range \<1,3\>. Some cells are empty.

Response from the same dataset using dstable2D

```auto
"Command 'table2DDS(D$var1,D$var2)' failed on '2': Error while evaluating 'dsBase::table2DDS(D$var1, D$var2)' -> Error in `[.default`(aa, i, ) : subscript out of bounds\n"

```

What is interesting, is the fact that I used another variables (var3,var4) for dstable I got the same parse error, but with dstable2D it returned me contingency tables.

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [4 August 2022 10:43 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/6 "2022-08-04T10:43:41Z")

</div>

Makal,

Thank you, I was expecting a more complicated call to “ds.table”, I will continue to try to reproduce the issue. I will ensure the tests only involve a single server.

Stuart

---

<div class="post-metadata">

**Author:** ![makal](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@makal](https://datashield.discourse.group/u/makal)\
**Post date:** [9 August 2022 11:42 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/7 "2022-08-09T11:42:27Z")

</div>

Hey Stuart,

Did you find anything related to this error? Or can I help you somehow?

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [9 August 2022 13:37 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/8 "2022-08-09T13:37:19Z")

</div>

Hi Makal,

I haven’t been able to reproduce the problems. My configurations is:

**Client-side:** R 4.2.1, DSI 1.4.0, DSOpal 1.4.1, dsBaseClient 6.2.0

**Server-side:** Opal 4.4.10, dsBase 6.2.0

Does this differ from your configuration?

Stuart

---

<div class="post-metadata">

**Author:** ![makal](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@makal](https://datashield.discourse.group/u/makal)\
**Post date:** [12 August 2022 14:51 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/9 "2022-08-12T14:51:44Z")

</div>

hi Stuart,

Server-side: Opal 4.4.9, dsBase 6.2.0

Client-side: R 4.1.3 DSI 1.4.0 DSOpal 1.3.1 dsBaseClient 6.2.0

I would like to share some toughts regarding that error and how I encounter it. I log in to the datashield UI on administrator profile, then I go to the proper table and choose `Summary` tab. Then I have red bar that `Table values index is out-of-date`, so I choose `Index now`. Therefore I can create a contingency table by selecting two variables. Before that I go to the variables and I add a categories by choosing `Discover` option. Once I have it, I do a contingency table and I receive 2 tables based on Frequency and Percentage.

Then I want to do the same in RStudio. Therefore, I log in on the same user, perform code written above and I receive an error above with error in parse. Regarding data and additional configuration: Regarding data and additional configuration:

- my table consists with 2 variables (integers) with about 200 rows of generated random values in a range \<1,10\>.
- nfilter.tab was set to 1 for testing purpose.

Question: What does it mean that `Table values index is out-of-date` in Datashield UI console?

Based on that I am a little bit confused that I receive different results (tables in Datashield UI console and an error in Rstudio). Now my assumptions are that the configuration of variables are wrong or something is missing in server configuration. Is there any document how to proper configure variables and upload data, because I could missed it.

Best regards

---

<div class="post-metadata">

**Author:** ![florian.schwarz](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@florian.schwarz](https://datashield.discourse.group/u/florian.schwarz)\
**Post date:** [19 August 2022 13:17 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/10 "2022-08-19T13:17:43Z")

</div>

So,

I have tried to figure out your problem with ds.table and I might have found something. It actually had nothing to do with the generated dataset (at least I couldn’t find anything so far).

```auto
library(dsBaseClient)
library(DSI)
library(DSOpal)

builder <- DSI::newDSLoginBuilder(.silent = FALSE)
builder$append(server = "Server-1", url = "http://192.168.56.150:8080/",
               user = "administrator", password = "datashield_test&",
               table = "MakalTest.MakalTest5", driver = "OpalDriver")

logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")

ds.table("D$var1", "D$var2")

```

The parsing error message (see below) comes from naming the server in the builder$append command. In my example “Server-1”. R can’t parse specific symbols (e.g. hyphen) depending on their position ([r - Unexpected symbol error in parse(text = str) with hyphen after a digit - Stack Overflow](https://stackoverflow.com/questions/17639325/unexpected-symbol-error-in-parsetext-str-with-hyphen-after-a-digit)).

```auto
Aggregated (tableDS(rvar.transmit = "D$var1", cvar.transmit = "D$var2", stvar.transmit = NULL, ...

 Data in all studies were valid 

Study 1 : No errors reported from this study

Error in parse(text = output.text.props.counts.dim.2) : 
  <text>:1:38: unexpected input
1: output.list=list(TABLE.STUDY.Server-1_

```

In ds.table codeline 452 the variable “study.names.valid” is being built from the names(datasources) command and then carried forward to into the output.text.props.counts.dim.2 variable. I have not seen it in the code yet, but perhaps also the Project or Table name in Opal could lead to problems.

Do you have any special symbols in your Server/Project/Table names?

Best, Florian

---

<div class="post-metadata">

**Author:** ![makal](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@makal](https://datashield.discourse.group/u/makal)\
**Post date:** [19 August 2022 14:48 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/11 "2022-08-19T14:48:35Z")

</div>

Hey Florian, I really appreciate your help! Youre right I used dash in the “Server name” like you in the example, I have removed it and I see the contingency table now 🙂By the way I see that you used in this example image from workshops, I also wanted to used it, but I gave up due to an error in command `connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")` with error that I need https. How do you resolved it?

Thank you for your help

---

<div class="post-metadata">

**Author:** ![florian.schwarz](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@florian.schwarz](https://datashield.discourse.group/u/florian.schwarz)\
**Post date:** [19 August 2022 15:00 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/12 "2022-08-19T15:00:01Z")

</div>

Hi Makal,

I just figured that problem out today as I recently updated everything in R. The trick is to go down on the opalr Version to 3.0.2 or lower ([Releases · obiba/opalr · GitHub](https://github.com/obiba/opalr/releases)) as the newest version enforces the https usage.

```auto
installr::uninstall.packages("opalr")
devtools::install_github("obiba/opalr", ref = "3.0.2")

```

And I think, Stuart mentioned to me that Opal needs to be below 4.1. But most VM Images are below that Version.

My Client-side: DSI: 1.4.0 DSOpal: 1.3.1 dsBaseClient: 6.2.0 opalr: 3.0.2

Best, Florian

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [19 August 2022 15:19 UTC](https://datashield.discourse.group/t/ds-table-error-in-parse/594/13 "2022-08-19T15:19:54Z")

</div>

Be aware that if you go with `http` (i.e. non secure) your credentials will travel in clear over the network… If you connect to `http://localhost:8080` only a warning will be issued.

Yannick
