Commit ead85fdf4b14c5db7733c232b78752cbe3b03656
Merge pull request #8 from biometrics/plot_noquit
plot pivot update
Showing
1 changed file
with
8 additions
and
2 deletions
sdk/core/plot.cpp
| ... | ... | @@ -326,8 +326,14 @@ struct RPlot |
| 326 | 326 | pivotItems = QVector< QSet<QString> >(pivotHeaders.size()); |
| 327 | 327 | foreach (const QString &fileName, files) { |
| 328 | 328 | QStringList pivots = getPivots(fileName, false); |
| 329 | - if (pivots.size() != pivotHeaders.size()) | |
| 330 | - qFatal("Pivot size mismatch: [%s] [%s]", qPrintable(pivotHeaders.join(",")), qPrintable(pivots.join(","))); | |
| 329 | + | |
| 330 | + // If the number of pivots don't match, abandon the directory/filename labeling scheme | |
| 331 | + if (pivots.size() != pivotHeaders.size()) { | |
| 332 | + pivots.clear(); | |
| 333 | + pivots.push_back(QFileInfo(fileName).completeBaseName()); | |
| 334 | + pivotHeaders.clear(); | |
| 335 | + pivotHeaders.push_back("File"); | |
| 336 | + } | |
| 331 | 337 | file.write(qPrintable(QString("tmp <- read.csv(\"%1\")\n").arg(fileName).replace("\\", "\\\\"))); |
| 332 | 338 | for (int i=0; i<pivots.size(); i++) { |
| 333 | 339 | pivotItems[i].insert(pivots[i]); | ... | ... |