{"action":"closed","issue":{"url":"https://api.github.com/repos/HenrikBengtsson/R.matlab/issues/35","repository_url":"https://api.github.com/repos/HenrikBengtsson/R.matlab","labels_url":"https://api.github.com/repos/HenrikBengtsson/R.matlab/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/HenrikBengtsson/R.matlab/issues/35/comments","events_url":"https://api.github.com/repos/HenrikBengtsson/R.matlab/issues/35/events","html_url":"https://github.com/HenrikBengtsson/R.matlab/issues/35","id":159208254,"number":35,"title":"writeMat stops including variables when a logical is encountered in the arguments","user":{"login":"epiasini","id":307807,"avatar_url":"https://avatars.githubusercontent.com/u/307807?v=3","gravatar_id":"","url":"https://api.github.com/users/epiasini","html_url":"https://github.com/epiasini","followers_url":"https://api.github.com/users/epiasini/followers","following_url":"https://api.github.com/users/epiasini/following{/other_user}","gists_url":"https://api.github.com/users/epiasini/gists{/gist_id}","starred_url":"https://api.github.com/users/epiasini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epiasini/subscriptions","organizations_url":"https://api.github.com/users/epiasini/orgs","repos_url":"https://api.github.com/users/epiasini/repos","events_url":"https://api.github.com/users/epiasini/events{/privacy}","received_events_url":"https://api.github.com/users/epiasini/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HenrikBengtsson/R.matlab/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-08T16:17:09Z","updated_at":"2016-07-03T18:45:21Z","closed_at":"2016-07-03T18:45:21Z","body":"I'm using the latest version of R.matlab from CRAN (3.5.1), R 3.3.0 and Matlab 2014a.\r\n\r\nIf I try the following:\r\n```R\r\nwriteMat('test_wm.mat', t=TRUE)\r\n```\r\nwriteMat will complete without complaining, but the matfile will look empty once loaded in MATLAB, instead of containing a logical variable named `t`. This also happens if `t=FALSE`. Furthermore, if I do the following:\r\n```R\r\nwriteMat('test_wm.mat', x=1, t=TRUE)\r\n```\r\nthe file will contain `x`, but not `t`, when loaded in MATLAB (and the same thing happens for a larger number of variables, as long as they are listed before `t` in the list of arguments).  Finally, if I do\r\n```R\r\nwriteMat('test_wm.mat', x=1, t=TRUE, y=2)\r\n```\r\nwriteMat will once again complete succesfully, but MATLAB will fail to load the file with the following message:\r\n```matlab\r\n>> t = load('test_wm.mat')\r\nError using load\r\nCan't read file /home/[myuser]/test_wm.mat.\r\n```\r\n\r\nThis is relatively straightforward to work around by just casting any logical value to numeric before saving the file and then converting them back to logical (if needed) on the MATLAB side; still, I figured it would have been helpful to point out the issue.\r\n\r\nThanks!"}}
{"actor":{"display_login":"HenrikBengtsson"}}