Displaying 6 results from an estimated 6 matches for "lvg_table2".
2017 Oct 05
4
dealing with a messy dataset
...2.4 1.75
What I would like to do is to read this dataset, but I would like that
the space between And and XVIII is not interpreted as 2 different
columns but as the name of the galaxy in one column.
How is it possible to do so?
For instance I did this
data1<-read.table("lvg_table2.txt",skip=70,fill=T) where I used fill=T
because the rows don't have the same number of features since R splits
the name of the galaxies into 2 columns because of the space.
Best Regards, thanks in advance
Jean-Philippe Fontaine
--
Jean-Philippe Fontaine
PhD Student in Astroparticl...
2017 Oct 05
3
dealing with a messy dataset
dear Jim,
Thanks for your reply and your proposition.
I forgot to provide the header of the dataframe, here it is:
================================================================================
Byte-by-byte Description of file: lvg_table2.dat
--------------------------------------------------------------------------------
Bytes Format Units Label Explanations
--------------------------------------------------------------------------------
1- 18 A18 --- Name Galaxy name in well-known catalogs
20- 21 I...
2017 Oct 05
1
dealing with a messy dataset
dear Jim,
Yes I fixed the problem. Thanks again all of you for your contribution!
This worked :
start <- c(1, 20, 35, 41, 44, 48, 53, 59, 64, 70, 76, 78, 83, 88,
+ 93, 114, 122, 127)
data1<-read_fwf("lvg_table2.txt",skip=70, fwf_widths(diff(start)))
Well now I know how to deal with fixed-width files :)
Cheers
Jean-Philippe
On 05/10/2017 18:42, jim holtman wrote:
> You should be able to use that header information to create the
> correct parameters to the read_fwf function to read in the d...
2017 Oct 05
0
dealing with a messy dataset
...ontaine at gssi.infn.it> wrote:
> dear Jim,
>
> Thanks for your reply and your proposition.
>
> I forgot to provide the header of the dataframe, here it is:
> ================================================================================
> Byte-by-byte Description of file: lvg_table2.dat
> --------------------------------------------------------------------------------
> Bytes Format Units Label Explanations
> --------------------------------------------------------------------------------
> 1- 18 A18 --- Name Galaxy name in well-known ca...
2017 Oct 05
0
dealing with a messy dataset
...75
>
> What I would like to do is to read this dataset, but I would like that the space between And and XVIII is not interpreted as 2 different columns but as the name of the galaxy in one column.
> How is it possible to do so?
>
> For instance I did this data1<-read.table("lvg_table2.txt",skip=70,fill=T) where I used fill=T because the rows don't have the same number of features since R splits the name of the galaxies into 2 columns because of the space.
>
>
> Best Regards, thanks in advance
>
>
> Jean-Philippe Fontaine
>
> --
> Jean-Ph...
2017 Oct 05
0
dealing with a messy dataset
...> What I would like to do is to read this dataset, but I would like that the
> space between And and XVIII is not interpreted as 2 different columns but as
> the name of the galaxy in one column.
> How is it possible to do so?
>
> For instance I did this data1<-read.table("lvg_table2.txt",skip=70,fill=T)
> where I used fill=T because the rows don't have the same number of features
> since R splits the name of the galaxies into 2 columns because of the space.
>
>
> Best Regards, thanks in advance
>
>
> Jean-Philippe Fontaine
>
> --
> Jea...