From d36666ac2486b09daeb8b137af528c54412969d5 Mon Sep 17 00:00:00 2001 From: Taha Ahmed Date: Sun, 11 Dec 2011 19:24:43 +0100 Subject: [PATCH] Made regex more specific (now matches "\\labreport...}{"). Previous behaviour matched first part of \SI{}{} as well and was unwanted. --- SubstrateHistory.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubstrateHistory.R b/SubstrateHistory.R index 36ae5cd..5bad2f6 100644 --- a/SubstrateHistory.R +++ b/SubstrateHistory.R @@ -12,7 +12,7 @@ SubstrateHistory <- function(sampleid) { # Loops remove all "\\labreport{...}" strings (they make the table too wide otherwise) for (j in 1:dim(sample.history)[1]) { for (k in 1:dim(sample.history)[2]) { - sample.history[j, k] <- gsub("^.*?\\}\\{", "", sample.history[j, k]) + sample.history[j, k] <- gsub("^\\\\labreport.*?\\}\\{", "", sample.history[j, k]) sample.history[j, k] <- gsub("\\}$", "", sample.history[j, k]) } }