> From: Johann Hibschman
> Sent: Wednesday, 23 June 2010 02:39
> 
> My basic goal is to read a CSV file into some kind of named associative
> structure, then do analysis on the columns of that data.
> 
> Imagining that I have a csv file with time, price, and volume columns,
> in R, I can do:
> 
>   data <- read.csv("file.csv")          # no assumptions on cols
>   c(mean(data$price), sd(data$price))
> 
> What would be the equivalent in J?

J probably isn't quite as set up for associative structures as R or q 
nevertheless, assuming the first row contains names that can be interpreted as 
valid J names:

require 'tables/csv stats/base'    
data=: readcsv 'file.csv'
({.data) =: |: makenum }. Data
(mean , stddev) price


Note that 'tables/csv' and 'stats/base' are addons (like R packages) that you 
download using Package Manager.

> Hopefully this is the right forum to ask this; if not, please point me
> in the right direction.

Probably better in the programming forum.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to