I currently have a simple task of graphing many different datasets (26 here, with many different instances where I'll need to do, say, 26 different ones from the same template). I'm trying to minimize the amount of "name changing" I'll have to do manually, as the treatment of each dataset is virtually identical aside from the names and (obviously) individual data points being graphed.
For example, I have a large table (specifically imported using ExcelRead with ExcelLink) with:
data = {{DataSetName1, m1, m2, m3,m4},{DataSetName2, m1, m2, m3, m4},...}
etc. for all 26 datasets and their measurements 1 - 4 as a function of time.
Next I have to extract each datasets information individually using
time=[5, 10, 20, 1440]
for the time intervals my data is taken at,
DataSet1raw = Rest[Part[data, 2, 1;;5]
and then
DataSet1 = Transpose[{time, DataSet1raw}]
DataSetList = {"DataSet1Name","DataSet2Name","...", "DataSet26Name"}
to finally yield the time-series {{t1, m1},{t2, m2}, ...}
form and a list of the names of each set.
Combining the list of time-series (& names respectively) to graph in thirds for ease of viewing,
AllSets = {DataSet1, DataSet2, ..., DataSet26}
FirstCollection = Take[AllSets, 1;;9]
SecondCollection = Take[AllSets, 10;;18]
FinalCollection = Take[AllSets, 19;;26]
After doing this individually for 26 numbered data sets (such as NB1,NB2,NB3, etc., all of which contain name-specific components previously used), it is finally in the form where I can graph the datasets easily using:
ListLogLinearPlot[FirstCollection, Legending, etc.]
So, my question is a general one of how to optimize this process. Currently I'm leaning towards generalizing the terms like I've done above, and trying to use a simple process of "Specific name = generic name," but suspect my lack of general organizational Mathematica familiarity (and coding in general) has me complicating much of this process.
Thank you for taking the time to respond!
Update:
After investigating further as to how to possibly simplify the process, I've at least found in the documentation a means of possibly doing the renaming of each drug iteration (26 times here) by a series of ToString
and ToExpression
functions, in case anyone else is facing a similar dilemma.