Message Boards Message Boards

0
|
4563 Views
|
6 Replies
|
6 Total Likes
View groups...
Share
Share this post:

How can I merge lists using Riffle and Partition, when I need a function?

Posted 11 years ago

I've got the data, containing the values in 5 studies and the days in the first column. I am trying to create the ErrorListPlot, but I've got the problem with syntax.

Needs["ErrorBarPlots`"]

pathTransplant = 
  "C:UsersMeklonownCloudRegenLabDataWeightTransplant_
weight.xlsx";

dataTransplant1Weight = Import[pathTransplant, {"Data", 1, All, 2}];
dataTransplant2Weight = Import[pathTransplant, {"Data", 1, All, 3}];
dataTransplant3Weight = Import[pathTransplant, {"Data", 1, All, 4}];
dataTransplant4Weight = Import[pathTransplant, {"Data", 1, All, 5}];
dataTransplant5Weight = Import[pathTransplant, {"Data", 1, All, 6}];
dataTransplantWeight = List[dataTransplant1Weight, dataTransplant2Weight, dataTransplant3Weight, dataTransplant4Weight, dataTransplant5Weight];

dataDay = Import[pathTransplant, {"Data", 1, All, 1}];
meanTransplant = Mean[dataTransplantWeight];
standardErrorTransplant = StandardDeviation[dataTransplantWeight]/Sqrt[Length[dataTransplantWeight]];


plotDataTransplant = Partition[Riffle[dataDay, meanTransplant], 2]
plotDataTransplantErr = Partition[Riffle[plotDataTransplant, standardErrorTransplant], 2]

ErrorListPlot[plotDataTransplantErr]

The problem is with plotDataTransplantErr = Partition[Riffle[plotDataTransplant, standardErrorTransplant], 2] It gives me the output like this:

{{{0., 245.6}, 3.9064}, {{1., 204.8}, 3.33766}, {{3., 202.6}, 2.65707}...

It is practically what I need, but I cannot insert the text "ErrorBar" in it, as I need something like this for input of ErrorListPlot:

{{{0., 245.6}, ErrorBar [3.9064]}, {{1., 204.8}, ErrorBar [3.33766]}, {{3., 202.6}, ErrorBar [2.65707]}

This doesn't work either:

ErrorListPlot[{plotDataTransplant, ErrorBar[standardErrorTransplant]}]

Strange plot

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use