select where u is (] #~ u) fromthis

joins can be a bit tricky (though as Chris mentioned you can consider jd or 
jdb).  You can also look up inverted tables on wiki.

Some extra options in J when working with data is to separate your tables by 
data type so that you have a lot of 1 to 1 relationships, but text and numbers 
are in different variables/files so that you can avoid boxing.  This is the 
main motivations behind column databases such as JD, but grouping columns by 
datatype can have some related J efficiencies.

sql one-to-many joins produce tables where the rows from the one side get 
repeated for each of the many side.  An alternative that existed before sql is 
to look up stuff in one table based on another table.  That can often be done 
in one short line in J, and potentially is more optimized (based on knowlege of 
where you should look first) than sql.

Another join alternative available in J is to box the many side records into a 
single cell and so avoid data repetition from the one side of the join.  With 
boxes in J, you can store variable lists, lists of lists, or trees of lists of 
tree lists into a single cell, so J can combine relational and document 
structures.

group by functionality can often be accomplished with key /.


________________________________
From: Ryan <[email protected]>
To: Programming forum <[email protected]> 
Sent: Sunday, December 7, 2014 9:57 PM
Subject: [Jprogramming] J and data analysis/relational algebra


I appreciate how helpful this forum has been so far so I'd thought I'd
ask another question.

Essentially, can someone point me to how J users perform the basic
data manipulation operations that you can do, for example, using R's
dplyr or SQL queries?  

Specifically, I want to be able to (mainly on a bunch of csv files):
Do unions, joins, selects, filters, group by's, 
and create new columns as functions of other columns.

I want to get a sense of how easy it is compared to R, and hopefully
learn efficient ways of doing it in J.

thanks for any help,
Ryan


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to