0

I am having a hard time pulling the last column of data for analysis.

BlockData <- read.csv(file.choose(),header=T,sep="\t")

This is a sample the data (I have added the column header c1, c2 and c3):

c1,c2,c3
20170918 045759;50.44;1
20170918 045805;50.44;1
20170918 045820;50.44;1
Dave2e
  • 22,192
  • 18
  • 42
  • 50
bruceb85
  • 1
  • 1
  • 1
    What did you try? There are tons of answers to your question already – Tunn Sep 26 '17 at 01:21
  • not quite clear on your data. Is it separated by `tab` or by `;`? If it is separated by `;`, then you should put `read.csv(file.choose(), header=T, sep=";")`. Pulling the last column can be done using `BlockData[,ncol(BlockData)]` – addicted Sep 26 '17 at 01:56
  • `read.csv` assumes separator is `,`. `read.csv2` takes separator `;` – Ott Toomet Sep 26 '17 at 03:32
  • It is even not clear if the separator is ",", " ", or ";". Is your file small and you can you fix it by hand? Otherwise take a look at [this question/answer](https://stackoverflow.com/questions/23568981/how-to-read-data-with-different-separators) – jay.sf Sep 26 '17 at 07:46
  • I am able to load the file. It is market data, I am interested in the last column which is the order size. 20170918 040001;50.42;1 I would like to analyze that column but still cannot isolate it. Perhaps an example of finding the mean for the last column? – bruceb85 Sep 27 '17 at 01:20
  • I am still unable to isolate the last column, anyone have any suggestions? – bruceb85 Sep 28 '17 at 00:07

0 Answers0