read.delim

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

read.delim

Shane Carey
Hi,

Im reading in a .txt file into R that consists of 5 columns, however, when
imported into R, it reads all the data into just one column. Is there a way
of telling R to create a dataframe with 5 columns rather than putting all
the data into one column?

Thanks

--
Shane

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
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: read.delim

Steve Friedman-2
You have to tell R what the column delimiter is.  See Read.table.
On Apr 2, 2013 8:28 AM, "Shane Carey" <[hidden email]> wrote:

> Hi,
>
> Im reading in a .txt file into R that consists of 5 columns, however, when
> imported into R, it reads all the data into just one column. Is there a way
> of telling R to create a dataframe with 5 columns rather than putting all
> the data into one column?
>
> Thanks
>
> --
> Shane
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
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.