Problem with rio/haven

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with rio/haven

Sigbert Klinke
Hi,

I got the following error when reading a Stata file:

 > library("rio")
 > x <- import('XXX.dta')
Fehler in df_parse_dta_file(spec, encoding) :
   Evaluation error: Column name `Merge` must not be duplicated.
Use .name_repair to specify repair.

I understand that the column name "Merge" appears at least twice in the
Stata file.

My problem is that I have created the data as data.frame in R and saved
with the export command of rio. How could it be that I can save a data
set but I'am not able to read in again?

Sigbert

--
https://hu.berlin/sk
https://hu.berlin/mmstat3

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with rio/haven

Bert Gunter-2
My guess: See the check.names argument in ?data.frame. I suspect that
the code is using this -- or something like it -- with its value =
FALSE.

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Jul 30, 2019 at 1:22 AM Sigbert Klinke
<[hidden email]> wrote:

>
> Hi,
>
> I got the following error when reading a Stata file:
>
>  > library("rio")
>  > x <- import('XXX.dta')
> Fehler in df_parse_dta_file(spec, encoding) :
>    Evaluation error: Column name `Merge` must not be duplicated.
> Use .name_repair to specify repair.
>
> I understand that the column name "Merge" appears at least twice in the
> Stata file.
>
> My problem is that I have created the data as data.frame in R and saved
> with the export command of rio. How could it be that I can save a data
> set but I'am not able to read in again?
>
> Sigbert
>
> --
> https://hu.berlin/sk
> https://hu.berlin/mmstat3
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.