How to avoid the automatic sorting of the rows of table in opal

Dear all,

It seems that the rows of the imported table on the server were automatically sorted according to the rownames.

See below, the original rownames should be Var1, Var2…Var300. However it was sorted by opal.

Is there anyway the sorting can be avoided?

Regards,

Hank

Hi Hank,

I am not surprised by the order. The index are strings of characters. So it it is the correct order. However, you need to use a numerical index instead.

Patricia

https://www.datashield.ac.uk

In Opal, IDs are always considered as strings and then the sort is alphabetical. I think that the IDs are sorted by default so that the data paging is stable (there is usually no paging feature in the underlying database). Anyway, for advanced data viewing (sorting, filtering), it is recommended to use R.

Yannick

Hi Hank,

One potential (probably not the optimal) solution for this is to have an “index” variable (this can be a numeric from 1 up to the number of rows) in your dataset and after uploading the data you can then use the ds.dataFrameSort function to sort the data back by that “index”.

Or even better option: check the datashield.assign.table() documentation, there is the id.name parameter that allows you to specify the column name for the identifiers (default behavior is to set the identifiers in the data.frame row names).

Hi all,

Thanks for your suggestions, they are helpful. I would use it in my work.

Regards,

Hank