Is there a way to use is.finite in sparklyr? - r

I need to mutate a column so that non finite values are turned into zeroes.
I am using this code to do it:
df %>% mutate(column = replace(column, !is.finite(column), 0)
This usually works in base R, and I've seen that the replace function also does in Sparklyr. However, is.finite isn't implemented in Sparklyr and I get the following error:
Error: org.apache.spark.sql.AnalysisException: Undefined function: is.finite; line 14 pos 45
at org.apache.spark.sql.errors.QueryCompilationErrors$.noSuchFunctionError(QueryCompilationErrors.scala:1802)
at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$23.applyOrElse(Analyzer.scala:2049)
at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$23.applyOrElse(Analyzer.scala:2036)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:615)
at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:177)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:615)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$3(TreeNode.scala:620)
at org.apache.spark.sql.catalyst.trees.UnaryLike.mapChildren(TreeNode.scala:1249)
at org.apache.spark.sql.catalyst.trees.UnaryLike.mapChildren$(TreeNode.scala:1248)
at org.apache.spark.sql.catalyst.expressions.UnaryExpression.mapChildren(Expression.scala:519)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:620)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$3(TreeNode.scala:620)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:729)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:620)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$3(TreeNode.scala:620)
at org.apache.spark.sql.catalyst.trees.UnaryLike.mapChildren(TreeNode.scala:1249)
at org.apache.spark.sql.catalyst.trees.UnaryLike.mapChildren$(TreeNode.scala:1248)
at org.apache.spark.sql.catalyst.expressions.UnaryExpression.mapChildren(Expression.scala:519)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:620)
at org.apache.spark.sql.catalyst.plans.QueryPlan.$anonfun$transformExpressionsDownWithPruning$1(QueryPlan.scala:159)
at org.apache.spark.sql.catalyst.plans.QueryPlan.$anonfun$mapExpressions$1(QueryPlan.scala:200)
at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:177)
at org.apache.spark.sql.catalyst.plans.QueryPlan.transformExpression$1(QueryPlan.scala:200)
at org.apache.spark.sql.catalyst.plans.QueryPlan.recursiveTransform$1(QueryPlan.scala:211)
at org.apache.spark.sql.catalyst.plans.QueryPlan.$anonfun$mapExpressions$3(QueryPlan.scala:216)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.immutable.List.foreach(List.scala:431)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.immutable.List.map(List.scala:305)
at org.apache.spark.sql.catalyst.plans.QueryPlan.recursiveTransform$1(QueryPlan.scala:216)
at org.apache.spark.sql.catalyst.plans.QueryPlan.$anonfun$mapExpressions$4(QueryPlan.scala:221)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapProductIterator(TreeNode.scala:459)
at org.apache.spark.sql.catalyst.plans.QueryPlan.mapExpressions(QueryPlan.scala:221)
at org.apache.spark.sql.catalyst.plans.QueryPlan.transformExpressionsDownWithPruning(QueryPlan.scala:159)
at org.apache.spark.sql.catalyst.plans.QueryPlan.transformExpressionsWithPruning(QueryPlan.scala:130)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$$anonfun$resolveExpressionsWithPruning$1.applyOrElse(AnalysisHelper.scala:245)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$$anonfun$resolveExpressionsWithPruning$1.applyOrElse(AnalysisHelper.scala:244)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsDownWithPruning$2(AnalysisHelper.scala:170)
at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:177)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsDownWithPruning$1(AnalysisHelper.scala:170)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.allowInvokingTransformsInAnalyzer(AnalysisHelper.scala:323)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsDownWithPruning(AnalysisHelper.scala:168)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsDownWithPruning$(AnalysisHelper.scala:164)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveOperatorsDownWithPruning(LogicalPlan.scala:30)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsWithPruning(AnalysisHelper.scala:99)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsWithPruning$(AnalysisHelper.scala:96)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveOperatorsWithPruning(LogicalPlan.scala:30)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveExpressionsWithPruning(AnalysisHelper.scala:244)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveExpressionsWithPruning$(AnalysisHelper.scala:242)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveExpressionsWithPruning(LogicalPlan.scala:30)
at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$.apply(Analyzer.scala:2036)
at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$.apply(Analyzer.scala:2032)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$1(RuleExecutor.scala:215)
at scala.collection.IndexedSeqOptimized.foldLeft(IndexedSeqOptimized.scala:60)
at scala.collection.IndexedSeqOptimized.foldLeft$(IndexedSeqOptimized.scala:68)
at scala.collection.mutable.WrappedArray.foldLeft(WrappedArray.scala:38)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.executeBatch$1(RuleExecutor.scala:212)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$6(RuleExecutor.scala:284)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.apache.spark.sql.catalyst.rules.RuleExecutor$RuleExecutionContext$.withContext(RuleExecutor.scala:327)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$5(RuleExecutor.scala:284)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$5$adapted(RuleExecutor.scala:274)
at scala.collection.immutable.List.foreach(List.scala:431)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:274)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:188)
at org.apache.spark.sql.catalyst.analysis.Analyzer.org$apache$spark$sql$catalyst$analysis$Analyzer$$executeSameContext(Analyzer.scala:227)
at org.apache.spark.sql.catalyst.analysis.Analyzer.$anonfun$execute$1(Analyzer.scala:223)
at org.apache.spark.sql.catalyst.analysis.AnalysisContext$.withNewAnalysisContext(Analyzer.scala:172)
at org.apache.spark.sql.catalyst.analysis.Analyzer.execute(Analyzer.scala:223)
at org.apache.spark.sql.catalyst.analysis.Analyzer.execute(Analyzer.scala:187)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$executeAndTrack$1(RuleExecutor.scala:179)
at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:107)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.executeAndTrack(RuleExecutor.scala:179)
at org.apache.spark.sql.catalyst.analysis.Analyzer.$anonfun$executeAndCheck$1(Analyzer.scala:208)
at org.apache.spark.sql.catalyst.plans.logic

Related

Incomplete Expression in R

I'm currently running a time series script in R-Markdown where I pass the values of Percent Use and another vector of the time values. I am processing the two separate vectors with the regular c() function within r. The percentage vector is able to be passed through when compilining like normal, however I am running into trouble with the date/time vector. The length of both vectors are 749, the percentage vector just has values 0-100 passed within them. THe date/time vector has strings passed into them as such:
dt=c('2022-06-19 14:05:00.0','2022-06-19 14:06:00.0', ....
If I only pass a few arguments into the dt vector, it will compile regularly, however, once I increase the size to around half of what it needs to be I start getting the following error:
Error: Incomplete expression: dt=c('2022-06-19 12:40:00.0','2022-06-19 12:41:00.0','2022-06-19 12:42:00.0','2022-06-19 12:43:00.0','2022-06-19 12:44:00.0','2022-06-19 12:45:00.0','2022-06-19 12:46:00.0','2022-06-19 12:47:00.0','2022-06-19 12:48:00.0','2022-06-19 12:49:00.0','2022-06-19 12:50:00.0','2022-06-19 12:51:00.0','2022-06-19 12:52:00.0','2022-06-19 12:53:00.0','2022-06-19 12:54:00.0','2022-06-19 12:55:00.0','2022-06-19 12:56:00.0','2022-06-19 12:57:00.0','2022-06-19 12:58:00.0','2022-06-19 12:59:00.0','2022-06-19 13:00:00.0','2022-06-19 13:01:00.0','2022-06-19 13:02:00.0','2022-06-19 13:03:00.0','2022-06-19 13:04:00.0','2022-06-19 13:05:00.0','2022-06-19 13:06:00.0','2022-06-19 13:07:00.0','2022-06-19 13:08:00.0','2022-06-19 13:09:00.0','2022-06-19 13:10:00.0','2022-06-19 13:11:00.0','2022-06-19 13:12:00.0','2022-06-19 13:13:00.0','2022-06-19 13:14:00.0','2022-06-19 13:15:00.0','2022-06-19 13:16:00.0','2022-06-19 13:17:00.0','2022-06-19 13:18:00.0','2022-06-19 13:19:00.0','2022
At first I believed it could be a parenthesis in the wrong place, however, there is no mistakes with that. I've looked at other articles with somewhat similar issues and have seen a concept of a maximum size vector allowed, however the percentage vector was able to pass all 700. Is there a way to bypass this error, I feel that it is a memory/storage issue with R.
The full code is a lot but it is:
dt=c('2022-06-19 12:40:00.0','2022-06-19 12:41:00.0','2022-06-19 12:42:00.0','2022-06-19 12:43:00.0','2022-06-19 12:44:00.0','2022-06-19 12:45:00.0','2022-06-19 12:46:00.0','2022-06-19 12:47:00.0','2022-06-19 12:48:00.0','2022-06-19 12:49:00.0','2022-06-19 12:50:00.0','2022-06-19 12:51:00.0','2022-06-19 12:52:00.0','2022-06-19 12:53:00.0','2022-06-19 12:54:00.0','2022-06-19 12:55:00.0','2022-06-19 12:56:00.0','2022-06-19 12:57:00.0','2022-06-19 12:58:00.0','2022-06-19 12:59:00.0','2022-06-19 13:00:00.0','2022-06-19 13:01:00.0','2022-06-19 13:02:00.0','2022-06-19 13:03:00.0','2022-06-19 13:04:00.0','2022-06-19 13:05:00.0','2022-06-19 13:06:00.0','2022-06-19 13:07:00.0','2022-06-19 13:08:00.0','2022-06-19 13:09:00.0','2022-06-19 13:10:00.0','2022-06-19 13:11:00.0','2022-06-19 13:12:00.0','2022-06-19 13:13:00.0','2022-06-19 13:14:00.0','2022-06-19 13:15:00.0','2022-06-19 13:16:00.0','2022-06-19 13:17:00.0','2022-06-19 13:18:00.0','2022-06-19 13:19:00.0','2022-06-19 13:20:00.0','2022-06-19 13:21:00.0','2022-06-19 13:22:00.0','2022-06-19 13:23:00.0','2022-06-19 13:24:00.0','2022-06-19 13:25:00.0','2022-06-19 13:26:00.0','2022-06-19 13:27:00.0','2022-06-19 13:28:00.0','2022-06-19 13:29:00.0','2022-06-19 13:30:00.0','2022-06-19 13:31:00.0','2022-06-19 13:32:00.0','2022-06-19 13:33:00.0','2022-06-19 13:34:00.0','2022-06-19 13:35:00.0','2022-06-19 13:36:00.0','2022-06-19 13:37:00.0','2022-06-19 13:38:00.0','2022-06-19 13:39:00.0','2022-06-19 13:40:00.0','2022-06-19 13:41:00.0','2022-06-19 13:42:00.0','2022-06-19 13:43:00.0','2022-06-19 13:44:00.0','2022-06-19 13:45:00.0','2022-06-19 13:46:00.0','2022-06-19 13:47:00.0','2022-06-19 13:48:00.0','2022-06-19 13:49:00.0','2022-06-19 13:50:00.0','2022-06-19 13:51:00.0','2022-06-19 13:52:00.0','2022-06-19 13:53:00.0','2022-06-19 13:54:00.0','2022-06-19 13:55:00.0','2022-06-19 13:56:00.0','2022-06-19 13:57:00.0','2022-06-19 13:58:00.0','2022-06-19 13:59:00.0','2022-06-19 14:00:00.0','2022-06-19 14:01:00.0','2022-06-19 14:02:00.0','2022-06-19 14:03:00.0','2022-06-19 14:04:00.0','2022-06-19 14:05:00.0','2022-06-19 14:06:00.0','2022-06-19 14:07:00.0','2022-06-19 14:08:00.0','2022-06-19 14:09:00.0','2022-06-19 14:10:00.0','2022-06-19 14:11:00.0','2022-06-19 14:12:00.0','2022-06-19 14:13:00.0','2022-06-19 14:14:00.0','2022-06-19 14:15:00.0','2022-06-19 14:16:00.0','2022-06-19 14:17:00.0','2022-06-19 14:18:00.0','2022-06-19 14:19:00.0','2022-06-19 14:20:00.0','2022-06-19 14:21:00.0','2022-06-19 14:22:00.0','2022-06-19 14:23:00.0','2022-06-19 14:24:00.0','2022-06-19 14:25:00.0','2022-06-19 14:26:00.0','2022-06-19 14:27:00.0','2022-06-19 14:28:00.0','2022-06-19 14:29:00.0','2022-06-19 14:30:00.0','2022-06-19 14:31:00.0','2022-06-19 14:32:00.0','2022-06-19 14:33:00.0','2022-06-19 14:34:00.0','2022-06-19 14:35:00.0','2022-06-19 14:36:00.0','2022-06-19 14:37:00.0','2022-06-19 14:38:00.0','2022-06-19 14:39:00.0','2022-06-19 14:40:00.0','2022-06-19 14:41:00.0','2022-06-19 14:42:00.0','2022-06-19 14:43:00.0','2022-06-19 14:44:00.0','2022-06-19 14:45:00.0','2022-06-19 14:46:00.0','2022-06-19 14:47:00.0','2022-06-19 14:48:00.0','2022-06-19 14:49:00.0','2022-06-19 14:50:00.0','2022-06-19 14:51:00.0','2022-06-19 14:52:00.0','2022-06-19 14:53:00.0','2022-06-19 14:54:00.0','2022-06-19 14:55:00.0','2022-06-19 14:56:00.0','2022-06-19 14:57:00.0','2022-06-19 14:58:00.0','2022-06-19 14:59:00.0','2022-06-19 15:00:00.0','2022-06-19 15:01:00.0','2022-06-19 15:02:00.0','2022-06-19 15:03:00.0','2022-06-19 15:04:00.0','2022-06-19 15:05:00.0','2022-06-19 15:06:00.0','2022-06-19 15:07:00.0','2022-06-19 15:08:00.0','2022-06-19 15:09:00.0','2022-06-19 15:10:00.0','2022-06-19 15:11:00.0','2022-06-19 15:12:00.0','2022-06-19 15:13:00.0','2022-06-19 15:14:00.0','2022-06-19 15:15:00.0','2022-06-19 15:16:00.0','2022-06-19 15:17:00.0','2022-06-19 15:18:00.0','2022-06-19 15:19:00.0','2022-06-19 15:20:00.0','2022-06-19 15:21:00.0','2022-06-19 15:22:00.0','2022-06-19 15:23:00.0','2022-06-19 15:24:00.0','2022-06-19 15:25:00.0','2022-06-19 15:26:00.0','2022-06-19 15:27:00.0','2022-06-19 15:28:00.0','2022-06-19 15:29:00.0','2022-06-19 15:30:00.0','2022-06-19 15:31:00.0','2022-06-19 15:32:00.0','2022-06-19 15:33:00.0','2022-06-19 15:34:00.0','2022-06-19 15:35:00.0','2022-06-19 15:36:00.0','2022-06-19 15:37:00.0','2022-06-19 15:38:00.0','2022-06-19 15:39:00.0','2022-06-19 15:40:00.0','2022-06-19 15:41:00.0','2022-06-19 15:42:00.0','2022-06-19 15:43:00.0','2022-06-19 15:44:00.0','2022-06-19 15:45:00.0','2022-06-19 15:46:00.0','2022-06-19 15:47:00.0','2022-06-19 15:48:00.0','2022-06-19 15:49:00.0','2022-06-19 15:50:00.0','2022-06-19 15:51:00.0','2022-06-19 15:52:00.0','2022-06-19 15:53:00.0','2022-06-19 15:54:00.0','2022-06-19 15:55:00.0','2022-06-19 15:56:00.0','2022-06-19 15:57:00.0','2022-06-19 15:58:00.0','2022-06-19 15:59:00.0','2022-06-19 16:00:00.0','2022-06-19 16:01:00.0','2022-06-19 16:02:00.0','2022-06-19 16:03:00.0','2022-06-19 16:04:00.0','2022-06-19 16:05:00.0','2022-06-19 16:06:00.0','2022-06-19 16:07:00.0','2022-06-19 16:08:00.0','2022-06-19 16:09:00.0','2022-06-19 16:10:00.0','2022-06-19 16:11:00.0','2022-06-19 16:12:00.0','2022-06-19 16:13:00.0','2022-06-19 16:14:00.0','2022-06-19 16:15:00.0','2022-06-19 16:16:00.0','2022-06-19 16:17:00.0','2022-06-19 16:18:00.0','2022-06-19 16:19:00.0','2022-06-19 16:20:00.0','2022-06-19 16:21:00.0','2022-06-19 16:22:00.0','2022-06-19 16:23:00.0','2022-06-19 16:24:00.0','2022-06-19 16:25:00.0','2022-06-19 16:26:00.0','2022-06-19 16:27:00.0','2022-06-19 16:28:00.0','2022-06-19 16:29:00.0','2022-06-19 16:30:00.0','2022-06-19 16:31:00.0','2022-06-19 16:32:00.0','2022-06-19 16:33:00.0','2022-06-19 16:34:00.0','2022-06-19 16:35:00.0','2022-06-19 16:36:00.0','2022-06-19 16:37:00.0','2022-06-19 16:38:00.0','2022-06-19 16:39:00.0','2022-06-19 16:40:00.0','2022-06-19 16:41:00.0','2022-06-19 16:42:00.0','2022-06-19 16:43:00.0','2022-06-19 16:44:00.0','2022-06-19 16:45:00.0','2022-06-19 16:46:00.0','2022-06-19 16:47:00.0','2022-06-19 16:48:00.0','2022-06-19 16:49:00.0','2022-06-19 16:50:00.0','2022-06-19 16:51:00.0','2022-06-19 16:52:00.0','2022-06-19 16:53:00.0','2022-06-19 16:54:00.0','2022-06-19 16:55:00.0','2022-06-19 16:56:00.0','2022-06-19 16:57:00.0','2022-06-19 16:58:00.0','2022-06-19 16:59:00.0','2022-06-19 17:00:00.0','2022-06-19 17:01:00.0','2022-06-19 17:02:00.0','2022-06-19 17:03:00.0','2022-06-19 17:04:00.0','2022-06-19 17:05:00.0','2022-06-19 17:06:00.0','2022-06-19 17:07:00.0','2022-06-19 17:08:00.0','2022-06-19 17:09:00.0','2022-06-19 17:10:00.0','2022-06-19 17:11:00.0','2022-06-19 17:12:00.0','2022-06-19 17:13:00.0','2022-06-19 17:14:00.0','2022-06-19 17:15:00.0','2022-06-19 17:16:00.0','2022-06-19 17:17:00.0','2022-06-19 17:18:00.0','2022-06-19 17:19:00.0','2022-06-19 17:20:00.0','2022-06-19 17:21:00.0','2022-06-19 17:22:00.0','2022-06-19 17:23:00.0','2022-06-19 17:24:00.0','2022-06-19 17:25:00.0','2022-06-19 17:26:00.0','2022-06-19 17:27:00.0','2022-06-19 17:28:00.0','2022-06-19 17:29:00.0','2022-06-19 17:30:00.0','2022-06-19 17:31:00.0','2022-06-19 17:32:00.0','2022-06-19 17:33:00.0','2022-06-19 17:34:00.0','2022-06-19 17:35:00.0','2022-06-19 17:36:00.0','2022-06-19 17:37:00.0','2022-06-19 17:38:00.0','2022-06-19 17:39:00.0','2022-06-19 17:40:00.0','2022-06-19 17:41:00.0','2022-06-19 17:42:00.0','2022-06-19 17:43:00.0','2022-06-19 17:44:00.0','2022-06-19 17:45:00.0','2022-06-19 17:46:00.0','2022-06-19 17:47:00.0','2022-06-19 17:48:00.0','2022-06-19 17:49:00.0','2022-06-19 17:50:00.0','2022-06-19 17:51:00.0','2022-06-19 17:52:00.0','2022-06-19 17:53:00.0','2022-06-19 17:54:00.0','2022-06-19 17:55:00.0','2022-06-19 17:56:00.0','2022-06-19 17:57:00.0','2022-06-19 17:58:00.0','2022-06-19 17:59:00.0','2022-06-19 18:00:00.0','2022-06-19 18:01:00.0','2022-06-19 18:02:00.0','2022-06-19 18:03:00.0','2022-06-19 18:04:00.0','2022-06-19 18:05:00.0','2022-06-19 18:06:00.0','2022-06-19 18:07:00.0','2022-06-19 18:08:00.0','2022-06-19 18:09:00.0','2022-06-19 18:10:00.0','2022-06-19 18:11:00.0','2022-06-19 18:12:00.0','2022-06-19 18:13:00.0','2022-06-19 18:14:00.0','2022-06-19 18:15:00.0','2022-06-19 18:16:00.0','2022-06-19 18:17:00.0','2022-06-19 18:18:00.0','2022-06-19 18:19:00.0','2022-06-19 18:20:00.0','2022-06-19 18:21:00.0','2022-06-19 18:22:00.0','2022-06-19 18:23:00.0','2022-06-19 18:24:00.0','2022-06-19 18:25:00.0','2022-06-19 18:26:00.0','2022-06-19 18:27:00.0','2022-06-19 18:28:00.0','2022-06-19 18:29:00.0','2022-06-19 18:30:00.0','2022-06-19 18:31:00.0','2022-06-19 18:32:00.0','2022-06-19 18:33:00.0','2022-06-19 18:34:00.0','2022-06-19 18:35:00.0','2022-06-19 18:36:00.0','2022-06-19 18:37:00.0','2022-06-19 18:38:00.0','2022-06-19 18:39:00.0','2022-06-19 18:40:00.0','2022-06-19 18:41:00.0','2022-06-19 18:42:00.0','2022-06-19 18:43:00.0','2022-06-19 18:44:00.0','2022-06-19 18:45:00.0','2022-06-19 18:46:00.0','2022-06-19 18:47:00.0','2022-06-19 18:48:00.0','2022-06-19 18:49:00.0','2022-06-19 18:50:00.0','2022-06-19 18:51:00.0','2022-06-19 18:52:00.0','2022-06-19 18:53:00.0','2022-06-19 18:54:00.0','2022-06-19 18:55:00.0','2022-06-19 18:56:00.0','2022-06-19 18:57:00.0','2022-06-19 18:58:00.0','2022-06-19 18:59:00.0','2022-06-19 19:00:00.0','2022-06-19 19:01:00.0','2022-06-19 19:02:00.0','2022-06-19 19:03:00.0','2022-06-19 19:04:00.0','2022-06-19 19:05:00.0','2022-06-19 19:06:00.0','2022-06-19 19:07:00.0','2022-06-19 19:08:00.0','2022-06-19 19:09:00.0','2022-06-19 19:10:00.0','2022-06-19 19:11:00.0','2022-06-19 19:12:00.0','2022-06-19 19:13:00.0','2022-06-19 19:14:00.0','2022-06-19 19:15:00.0','2022-06-19 19:16:00.0','2022-06-19 19:17:00.0','2022-06-19 19:18:00.0','2022-06-19 19:19:00.0','2022-06-19 19:20:00.0','2022-06-19 19:21:00.0','2022-06-19 19:22:00.0','2022-06-19 19:23:00.0','2022-06-19 19:24:00.0','2022-06-19 19:25:00.0','2022-06-19 19:26:00.0','2022-06-19 19:27:00.0','2022-06-19 19:28:00.0','2022-06-19 19:29:00.0','2022-06-19 19:30:00.0','2022-06-19 19:31:00.0','2022-06-19 19:32:00.0','2022-06-19 19:33:00.0','2022-06-19 19:34:00.0','2022-06-19 19:35:00.0','2022-06-19 19:36:00.0','2022-06-19 19:37:00.0','2022-06-19 19:38:00.0','2022-06-19 19:39:00.0','2022-06-19 19:40:00.0','2022-06-19 19:41:00.0','2022-06-19 19:42:00.0','2022-06-19 19:43:00.0','2022-06-19 19:44:00.0','2022-06-19 19:45:00.0','2022-06-19 19:46:00.0','2022-06-19 19:47:00.0','2022-06-19 19:48:00.0','2022-06-19 19:49:00.0','2022-06-19 19:50:00.0','2022-06-19 19:51:00.0','2022-06-19 19:52:00.0','2022-06-19 19:53:00.0','2022-06-19 19:54:00.0','2022-06-19 19:55:00.0','2022-06-19 19:56:00.0','2022-06-19 19:57:00.0','2022-06-19 19:58:00.0','2022-06-19 19:59:00.0','2022-06-19 20:00:00.0','2022-06-19 20:01:00.0','2022-06-19 20:02:00.0','2022-06-19 20:03:00.0','2022-06-19 20:04:00.0','2022-06-19 20:05:00.0','2022-06-19 20:06:00.0','2022-06-19 20:07:00.0','2022-06-19 20:08:00.0','2022-06-19 20:09:00.0','2022-06-19 20:10:00.0','2022-06-19 20:11:00.0','2022-06-19 20:12:00.0','2022-06-19 20:13:00.0','2022-06-19 20:14:00.0','2022-06-19 20:15:00.0','2022-06-19 20:16:00.0','2022-06-19 20:17:00.0','2022-06-19 20:18:00.0','2022-06-19 20:19:00.0','2022-06-19 20:20:00.0','2022-06-19 20:21:00.0','2022-06-19 20:22:00.0','2022-06-19 20:23:00.0','2022-06-19 20:24:00.0','2022-06-19 20:25:00.0','2022-06-19 20:26:00.0','2022-06-19 20:27:00.0','2022-06-19 20:28:00.0','2022-06-19 20:29:00.0','2022-06-19 20:30:00.0','2022-06-19 20:31:00.0','2022-06-19 20:32:00.0','2022-06-19 20:33:00.0','2022-06-19 20:34:00.0','2022-06-19 20:35:00.0','2022-06-19 20:36:00.0','2022-06-19 20:37:00.0','2022-06-19 20:38:00.0','2022-06-19 20:39:00.0','2022-06-19 20:40:00.0','2022-06-19 20:41:00.0','2022-06-19 20:42:00.0','2022-06-19 20:43:00.0','2022-06-19 20:44:00.0','2022-06-19 20:45:00.0','2022-06-19 20:46:00.0','2022-06-19 20:47:00.0','2022-06-19 20:48:00.0','2022-06-19 20:49:00.0','2022-06-19 20:50:00.0','2022-06-19 20:51:00.0','2022-06-19 20:52:00.0','2022-06-19 20:53:00.0','2022-06-19 20:54:00.0','2022-06-19 20:55:00.0','2022-06-19 20:56:00.0','2022-06-19 20:57:00.0','2022-06-19 20:58:00.0','2022-06-19 20:59:00.0','2022-06-19 21:00:00.0','2022-06-19 21:01:00.0','2022-06-19 21:02:00.0','2022-06-19 21:03:00.0','2022-06-19 21:04:00.0','2022-06-19 21:05:00.0','2022-06-19 21:06:00.0','2022-06-19 21:07:00.0','2022-06-19 21:08:00.0','2022-06-19 21:09:00.0','2022-06-19 21:10:00.0','2022-06-19 21:11:00.0','2022-06-19 21:12:00.0','2022-06-19 21:13:00.0','2022-06-19 21:14:00.0','2022-06-19 21:15:00.0','2022-06-19 21:16:00.0','2022-06-19 21:17:00.0','2022-06-19 21:18:00.0','2022-06-19 21:19:00.0','2022-06-19 21:20:00.0','2022-06-19 21:21:00.0','2022-06-19 21:22:00.0','2022-06-19 21:23:00.0','2022-06-19 21:24:00.0','2022-06-19 21:25:00.0','2022-06-19 21:26:00.0','2022-06-19 21:27:00.0','2022-06-19 21:28:00.0','2022-06-19 21:29:00.0','2022-06-19 21:30:00.0','2022-06-19 21:31:00.0','2022-06-19 21:32:00.0','2022-06-19 21:33:00.0','2022-06-19 21:34:00.0','2022-06-19 21:35:00.0','2022-06-19 21:36:00.0','2022-06-19 21:37:00.0','2022-06-19 21:38:00.0','2022-06-19 21:39:00.0','2022-06-19 21:40:00.0','2022-06-19 21:41:00.0','2022-06-19 21:42:00.0','2022-06-19 21:43:00.0','2022-06-19 21:44:00.0','2022-06-19 21:45:00.0','2022-06-19 21:46:00.0','2022-06-19 21:47:00.0','2022-06-19 21:48:00.0','2022-06-19 21:49:00.0','2022-06-19 21:50:00.0','2022-06-19 21:51:00.0','2022-06-19 21:52:00.0','2022-06-19 21:53:00.0','2022-06-19 21:54:00.0','2022-06-19 21:55:00.0','2022-06-19 21:56:00.0','2022-06-19 21:57:00.0','2022-06-19 21:58:00.0','2022-06-19 21:59:00.0','2022-06-19 22:00:00.0','2022-06-19 22:01:00.0','2022-06-19 22:02:00.0','2022-06-19 22:03:00.0','2022-06-19 22:04:00.0','2022-06-19 22:05:00.0','2022-06-19 22:06:00.0','2022-06-19 22:07:00.0','2022-06-19 22:08:00.0','2022-06-19 22:09:00.0','2022-06-19 22:10:00.0','2022-06-19 22:11:00.0','2022-06-19 22:12:00.0','2022-06-19 22:13:00.0','2022-06-19 22:14:00.0','2022-06-19 22:15:00.0','2022-06-19 22:16:00.0','2022-06-19 22:17:00.0','2022-06-19 22:18:00.0','2022-06-19 22:19:00.0','2022-06-19 22:20:00.0','2022-06-19 22:21:00.0','2022-06-19 22:22:00.0','2022-06-19 22:23:00.0','2022-06-19 22:24:00.0','2022-06-19 22:25:00.0','2022-06-19 22:26:00.0','2022-06-19 22:27:00.0','2022-06-19 22:28:00.0','2022-06-19 22:29:00.0','2022-06-19 22:30:00.0','2022-06-19 22:31:00.0','2022-06-19 22:32:00.0','2022-06-19 22:33:00.0','2022-06-19 22:34:00.0','2022-06-19 22:35:00.0','2022-06-19 22:36:00.0','2022-06-19 22:37:00.0','2022-06-19 22:38:00.0','2022-06-19 22:39:00.0','2022-06-19 22:40:00.0','2022-06-19 22:41:00.0','2022-06-19 22:42:00.0','2022-06-19 22:43:00.0','2022-06-19 22:44:00.0','2022-06-19 22:45:00.0','2022-06-19 22:46:00.0','2022-06-19 22:47:00.0','2022-06-19 22:48:00.0','2022-06-19 22:49:00.0','2022-06-19 22:50:00.0','2022-06-19 22:51:00.0','2022-06-19 22:52:00.0','2022-06-19 22:53:00.0','2022-06-19 22:54:00.0','2022-06-19 22:55:00.0','2022-06-19 22:56:00.0','2022-06-19 22:57:00.0','2022-06-19 22:58:00.0','2022-06-19 22:59:00.0','2022-06-19 23:00:00.0','2022-06-19 23:01:00.0','2022-06-19 23:02:00.0','2022-06-19 23:03:00.0','2022-06-19 23:04:00.0','2022-06-19 23:05:00.0','2022-06-19 23:06:00.0','2022-06-19 23:07:00.0','2022-06-19 23:08:00.0','2022-06-19 23:09:00.0','2022-06-19 23:10:00.0','2022-06-19 23:11:00.0','2022-06-19 23:12:00.0','2022-06-19 23:13:00.0','2022-06-19 23:14:00.0','2022-06-19 23:15:00.0','2022-06-19 23:16:00.0','2022-06-19 23:17:00.0','2022-06-19 23:18:00.0','2022-06-19 23:19:00.0','2022-06-19 23:20:00.0','2022-06-19 23:21:00.0','2022-06-19 23:22:00.0','2022-06-19 23:23:00.')
I can understand saying there is a issue with the quotations, but I cant find it anywhere. It seems as there is a maximum allowed in a vector, if I compile only the first quarter of the entries it works, else wise on R studio it gives an error, and in the terminal it just expects more code so it gives you a + to add more instead of >.

R Conditional Filling of Value based on Test of Existing Value

In brief, I have a large dataframe (~750,000 rows) most of which have a NA value in the "Age" field. I want to assign the values held in the "AcutalAge" and "InterpAge" field where the "Age" field is empty (prioritizing the "ActualAge" field first). The code snippet below is not working. Any thoughts? All of the fields are ints ranging from 0 to 150 or so.
for (r in seq_len(nrow(TreeData))){
if (is.na(TreeData[r,"Age"])){
TreeData[r,"Age"] <- TreeData[r,"ActualAge"]
}
# use InterpAge field if not a sample age tree or ActualAge tree
if (is.na(TreeData[r,"Age"])){
TreeData[r,"Age"] <- TreeData[r,"InterpAge"]
}
}
Sample Data:
"","Stand_ID","Plot_ID","StandPlot_ID","Tree_ID","District","PlotNumber","DBH","Ht","TreeStatus","Remeasurement","CrRatio","Species","Abbrev","b1","b2","b3","b4","b5","Age","Elevation","Slope","Latitude","Longitude","InterpAge","ActualSpec","ActualCD","ActualSite","ActualAge","DomSpec","Inv_Year","Disturbance","Treatment"
"1","D10P112103","R0","D10P112103R0",59,10,112103,0.551181390613437,6.23359592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"2","D10P112103","R0","D10P112103R0",58,10,112103,0.472441218773127,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"3","D10P112103","R0","D10P112103R0",30,10,112103,0.433071109386563,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"4","D10P112103","R0","D10P112103R0",7,10,112103,0.748031890613437,7.54593184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"5","D10P112103","R0","D10P112103R0",41,10,112103,0.5905515,6.88976368711472,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"6","D10P112103","R0","D10P112103R0",17,10,112103,0.472441218773127,5.24934407822132,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"7","D10P112103","R0","D10P112103R0",20,10,112103,0.157480402346641,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"8","D10P112103","R0","D10P112103R0",67,10,112103,0.354330890613437,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"9","D10P112103","R0","D10P112103R0",47,10,112103,0.393701,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"10","D10P112103","R0","D10P112103R0",16,10,112103,0.472441218773127,5.57742815644264,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"11","D10P112103","R0","D10P112103R0",57,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"12","D10P112103","R0","D10P112103R0",49,10,112103,0.669291718773127,6.88976368711472,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"13","D10P112103","R0","D10P112103R0",62,10,112103,0.393701,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"14","D10P112103","R0","D10P112103R0",36,10,112103,0.393701,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"15","D10P112103","R0","D10P112103R0",53,10,112103,0.1968505,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"16","D10P112103","R0","D10P112103R0",15,10,112103,0.354330890613437,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"17","D10P112103","R0","D10P112103R0",63,10,112103,0.157480402346641,4.26509184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"18","D10P112103","R0","D10P112103R0",43,10,112103,0.393701,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"19","D10P112103","R0","D10P112103R0",4,10,112103,0.472441218773127,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"20","D10P112103","R0","D10P112103R0",79,10,112103,0.433071109386563,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"21","D10P112103","R0","D10P112103R0",66,10,112103,0.236220609386563,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"22","D10P112103","R0","D10P112103R0",28,10,112103,0.472441218773127,6.23359592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"23","D10P112103","R0","D10P112103R0",34,10,112103,0.118110304693282,4.26509184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"24","D10P112103","R0","D10P112103R0",46,10,112103,0.236220609386563,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"25","D10P112103","R0","D10P112103R0",21,10,112103,0.669291718773127,6.23359592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"26","D10P112103","R0","D10P112103R0",81,10,112103,0.275590695306718,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"27","D10P112103","R0","D10P112103R0",77,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"28","D10P112103","R0","D10P112103R0",64,10,112103,0.157480402346641,4.26509184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"29","D10P112103","R0","D10P112103R0",72,10,112103,0.472441218773127,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"30","D10P112103","R0","D10P112103R0",73,10,112103,0.354330890613437,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"31","D10P112103","R0","D10P112103R0",55,10,112103,0.1968505,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"32","D10P112103","R0","D10P112103R0",32,10,112103,1.181103,8.53018368711472,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"33","D10P112103","R0","D10P112103R0",13,10,112103,0.236220609386563,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"34","D10P112103","R0","D10P112103R0",12,10,112103,0.354330890613437,5.57742815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"35","D10P112103","R0","D10P112103R0",70,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"36","D10P112103","R0","D10P112103R0",75,10,112103,0.708661781226873,6.23359592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"37","D10P112103","R0","D10P112103R0",82,10,112103,0.157480402346641,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"38","D10P112103","R0","D10P112103R0",40,10,112103,0.787402,7.54593184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"39","D10P112103","R0","D10P112103R0",52,10,112103,0.551181390613437,5.57742815644264,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"40","D10P112103","R0","D10P112103R0",23,10,112103,0.748031890613437,6.23359592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"41","D10P112103","R0","D10P112103R0",6,10,112103,0.314960804693282,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"42","D10P112103","R0","D10P112103R0",31,10,112103,0.314960804693282,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"43","D10P112103","R0","D10P112103R0",45,10,112103,0.393701,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"44","D10P112103","R0","D10P112103R0",35,10,112103,0.354330890613437,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"45","D10P112103","R0","D10P112103R0",38,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"46","D10P112103","R0","D10P112103R0",80,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"47","D10P112103","R0","D10P112103R0",5,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"48","D10P112103","R0","D10P112103R0",60,10,112103,0.472441218773127,5.57742815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"49","D10P112103","R0","D10P112103R0",19,10,112103,0.748031890613437,6.88976368711472,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"50","D10P112103","R0","D10P112103R0",22,10,112103,0.866142218773127,7.87401631288528,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"51","D10P112103","R0","D10P112103R0",61,10,112103,0.354330890613437,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"52","D10P112103","R0","D10P112103R0",68,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"53","D10P112103","R0","D10P112103R0",33,10,112103,0.236220609386563,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"54","D10P112103","R0","D10P112103R0",76,10,112103,0.551181390613437,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"55","D10P112103","R0","D10P112103R0",3,10,112103,0.9842525,7.54593184355736,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"56","D10P112103","R0","D10P112103R0",51,10,112103,0.157480402346641,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"57","D10P112103","R0","D10P112103R0",27,10,112103,0.393701,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"58","D10P112103","R0","D10P112103R0",48,10,112103,0.511811281226873,6.23359592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"59","D10P112103","R0","D10P112103R0",18,10,112103,0.275590695306718,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"60","D10P112103","R0","D10P112103R0",65,10,112103,0.905512281226873,7.21784815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"61","D10P112103","R0","D10P112103R0",14,10,112103,0.1968505,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"62","D10P112103","R0","D10P112103R0",10,10,112103,0.669291718773127,7.21784815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,10,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"63","D10P112103","R0","D10P112103R0",25,10,112103,0.118110304693282,4.26509184355736,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"64","D10P112103","R0","D10P112103R0",24,10,112103,0.393701,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"65","D10P112103","R0","D10P112103R0",74,10,112103,0.629921609386563,6.88976368711472,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"66","D10P112103","R0","D10P112103R0",42,10,112103,0.314960804693282,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"67","D10P112103","R0","D10P112103R0",1,10,112103,2.755907,10.4986881564426,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"68","D10P112103","R0","D10P112103R0",39,10,112103,0.511811281226873,6.56168,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"69","D10P112103","R0","D10P112103R0",26,10,112103,0.433071109386563,5.57742815644264,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"70","D10P112103","R0","D10P112103R0",83,10,112103,0.314960804693282,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"71","D10P112103","R0","D10P112103R0",56,10,112103,0.275590695306718,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"72","D10P112103","R0","D10P112103R0",54,10,112103,0.157480402346641,4.59317592177868,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"73","D10P112103","R0","D10P112103R0",71,10,112103,0.314960804693282,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"74","D10P112103","R0","D10P112103R0",9,10,112103,0.433071109386563,5.57742815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"75","D10P112103","R0","D10P112103R0",84,10,112103,0.669291718773127,5.90551184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"76","D10P112103","R0","D10P112103R0",8,10,112103,0.275590695306718,4.92126,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"77","D10P112103","R0","D10P112103R0",11,10,112103,0.433071109386563,59.05512,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"78","D10P112103","R0","D10P112103R0",69,10,112103,0.157480402346641,4.26509184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"79","D10P112103","R0","D10P112103R0",50,10,112103,0.1968505,4.59317592177868,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"80","D10P112103","R0","D10P112103R0",44,10,112103,0.393701,5.24934407822132,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"81","D10P112103","R0","D10P112103R0",2,10,112103,0.354330890613437,4.92126,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"82","D10P112103","R0","D10P112103R0",78,10,112103,0.157480402346641,4.26509184355736,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"83","D10P112103","R0","D10P112103R0",29,10,112103,0.0787402011733204,4.26509184355736,0,0,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"84","D10P112103","R0","D10P112103R0",37,10,112103,0.393701,5.57742815644264,0,0,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2012,NA,NA
"85","D10P112103","R1","D10P112103R1",33,10,112103,0.708661781226873,6.56168,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"86","D10P112103","R1","D10P112103R1",48,10,112103,1.02362256245375,8.2021,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"87","D10P112103","R1","D10P112103R1",70,10,112103,0.748031890613437,6.56168,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"88","D10P112103","R1","D10P112103R1",76,10,112103,1.06299271877313,7.87401631288528,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"89","D10P112103","R1","D10P112103R1",71,10,112103,0.629921609386563,6.56168,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"90","D10P112103","R1","D10P112103R1",72,10,112103,0.826772062453747,7.87401631288528,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"91","D10P112103","R1","D10P112103R1",7,10,112103,1.61417406245375,11.48294,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"92","D10P112103","R1","D10P112103R1",111,10,112103,0.551181390613437,6.23359592177868,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"93","D10P112103","R1","D10P112103R1",114,10,112103,0.236220609386563,4.59317592177868,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"94","D10P112103","R1","D10P112103R1",34,10,112103,0.629921609386563,6.23359592177868,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"95","D10P112103","R1","D10P112103R1",74,10,112103,1.25984321877313,9.18635184355736,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"96","D10P112103","R1","D10P112103R1",42,10,112103,0.511811281226873,5.57742815644264,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"97","D10P112103","R1","D10P112103R1",102,10,112103,0.393701,5.57742815644264,0,1,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"98","D10P112103","R1","D10P112103R1",110,10,112103,0.472441218773127,5.57742815644264,0,1,NA,"ABBA","bF",0.4358,1.065,-0.0179,-0.7497,0.0251,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"99","D10P112103","R1","D10P112103R1",5,10,112103,0.629921609386563,8.2021,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,NA,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
"100","D10P112103","R1","D10P112103R1",10,10,112103,1.49606378122687,10.8267718435574,0,1,NA,"PIMA","bS",0.1324,1.1955,-0.0061,-1.2545,-0.0943,14,246,5,49.0973055553436,55.6901944446564,10,"bSbF",3,"M",10,"bS",2016,NA,NA
This worked like a charm (thanks #DennyChen):
setDT(TreeData)[is.na(Age), Age:= ActualAge]
setDT(TreeData)[is.na(Age), Age:= InterpAge]
According to the answer post by #UnsoughtNine :
After setDT(), the table TreeData had been changed to a data.table object.
There is no need to setDT() again in the secong line of code.
It can also work with combining %>% pipe operator in magrittr package :
setDT(TreeData)[is.na(Age), Age:= ActualAge] %>%
.[is.na(Age), Age:= InterpAge]

Too many values in one argument case_when?

I am not sure why this code doesnt run. But if it breaks it into 2 smaller chunks then it works. Is there anyway i can run this whole chunk at once?
When I run this code it appears the plus sign in the console and I couldnt click run in R markdown
dataT4<- dataT4 %>% mutate (coupleID=case_when(id==10011~1, id==10021~2,
id==10032~3, id==10041~4,id==10062~5, id==10071~6,id==10082~7, id==10092~8,
id==10112~9, id==10121~10,id== 10131~11, id==10142~12, id==10151~13,
id==10162~14,id==10171~15, id==10181~16, id==10202~17, id==10212~18, id==10221~19,
id==10232~20, id==10242~21, id==10251~22, id==10262~23, id==10271~24, id==10292~25,
id==10311~26, id==10332~27, id==10342~28, id==10351~29, id==10361~30, id==10372~31,
id==10382~32, id==10391~33, id==10401~34, id==10412~35, id==10421~36, id==10432~37,
id==10442~38, id==10452~39, id==10461~40, id==10471~41, id==10481~42, id==10492~43,
id==10501~44, id==10511~45, id==10521~46, id==10532~47, id==10542~48, id==10562~49,
id==10581~50, id==10592~51, id==10602~52, id==10611~53, id==10642~54, id==10651~55,
id==10662~56, id==10672~57, id==10681~58, id==10702~59, id==10761~60, id==10782~61,
id==10791~62, id==10802~63, id==10812~64, id==10822~65, id==10831~66, id==10852~67,
id==10862~68, id==10881~69, id==10912~70, id==10942~71, id==10951~72, id==10962~73,
id==10972~74, id==10982~75, id==10992~76, id==11001~77, id==11031~78, id==11052~79,
id==11061~80, id==11072~81, id==11092~82, id==11101~83, id==11112~84, id==11171~85,
id==11192~86, id==11202~87, id==11221~88, id==11231~89, id==11252~90, id==11261~91,
id==11281~92, id==11292~93, id==11322~94, id==11332~95, id==11372~96, id==11382~97,
id==11391~98, id==11411~99, id==11422~100, id==11441~101, id==11461~102,
id==11471~103, id==11492~104, id==11501~105, id==11512~106,
id==11521~107,id==11562~108,id==11591~109, id==11601~110, id==11611~111,
id==11621~112, id==11632~113, id==11641~114, id==11651~115, id==11662~116,
id==11682~117,id==11691~118,id==11712~119, id==11771~120, id==11782~121,
id==11811~122, id==11821~123, id==11831~124, id==11841~125, id==11852~126,
id==11861~127,id==11872~128,id==11882~129, id==11892~130, id==11902~131,
id==11911~132, id==11922~133, id==11961~134, id==11972~135,
id==11992~136,id==12011~137, id==12041~138, id==12052~139, id==12061~140,
id==12081~141, id==12101~142, id==12111~143, id==12122~144, id==12131~145,
id==12142~146, id==12151~147, id==12161~148, id==12182~149, id==12191~150,
id==12201~151, id==12232~152, id==12261~153, id==12272~154, id==12322~155,
id==12332~156, id==12342~157, id==12352~158, id==12382~159, id==12392~160,
id==12401~161, id==12411~162, id==12421~163, id==12432~164, id==12441~165,
id==12451~166, id==12461~167, id==12471~168, id==12492~169, id==12501~170,
id==12512~171, id==12521~172, id==12542~173, id==12552~174, id==12562~175,
id==12572~176, id==12581~177, id==12612~178, id==12622~179, id==12652~180,
id==12662~181, id==12682~182, id==12701~183, id==12712~184, id==12731~185,
id==12741~186, id==12762~187, id==12792~188, id==12802~189, id==12811~190,
id==12822~191, id==12832~192, id==12841~193, id==12862~194, id==12882~195,
id==12891~196, id==12911~197, id==12931~198, id==12942~199, id==12952~200,
id==12961~201, id==12972~202, id==13011~203, id==13021~204, id==13032~205,
id==13042~206, id==13061~207, id==13082~208, id==13102~209, id==13111~210,
id==13132~211, id==13142~212, id==13151~213, id==13162~214, id==13191~215,
id==13202~216, id==13212~217, id==13262~218, id==13271~219, id==13281~220,
id==13311~221, id==13322~222, id==13331~223, id==13351~224, id==13361~225,
id==13372~226, id==13422~227, id==13432~228, id==13452~229, id==13462~230,
id==13472~231, id==13481~232, id==13501~233, id==13511~234, id==13521~235,
id==13561~236, id==13571~237, id==13601~238, id==13612~239, id==13632~240,
id==13642~241, id==13652~242, id==13662~243, id==13671~244, id==13681~245,
id==13691~246, id==13701~247, id==13711~248, id==13732~249, id==13742~250,
id==13752~251, id==13782~252, id==13842~253, id==13802~254, id==13822~255,
id==13851~256, id==13872~257, id==13882~258, id==13892~259, id==13912~260,
id==13921~261, id==13932~262, id==13941~263, id==13952~264, id==13971~265,
id==13981~266, id==13992~267, id==14011~268, id==14021~269, id==14031~270,
id==14041~271, id==14052~272, id==14072~273, id==14111~274, id==14131~275,
id==14162~276, id==14172~277, id==14182~278, id==14191~279, id==14212~280,
id==14222~281, id==14241~282, id==14261~283, id==14291~284, id==14302~285,
id==14312~286, id==14321~287, id==14342~288, id==14352~289, id==14362~290,
id==14371~291, id==14392~292, id==14402~293, id==14432~294, id==14451~295,
id==14472~296, id==14482~297, id==14491~298, id==14511~299, id==14521~300,
id==14531~301, id==14541~302, id==14552~303, id==14562~304, id==14572~305,
id==14581~306, id==14592~307, id==14602~308, id==14621~309, id==14632~310,
id==14641~311, id==14651~312, id==14671~313, id==14681~314, id==14692~315,
id==14712~316, id==14722~317, id==14732~318, id==14741~319, id==14751~320,
id==14781~321, id==14792~322, id==14812~323, id==14842~324, id==14852~325,
id==14862~326, id==14882~327, id==14892~328, id==14901~329, id==11012~330))
As a single line it is just too long to be parsed. You may be better served putting all of these values into a separate data.frame and merging it into your data instead of using a giant case_when.
Usually when I want to do something like this I'll open Excel or something similar, put column names in the first row (here that would be id and couple_id) and enter all of the values, save it as a CSV, then read the CSV into R as a data.frame, and then merge it.
You can use rank:
dataT4 <- data.frame(id=c(10011, 10021, 10382, 11012))
dataT4 <- dataT4 %>% mutate (coupleID=rank(id))
dataT4
id coupleID
1 10011 1
2 10021 2
3 10382 3
4 11012 4
Data:
dataT4 <- data.frame(id=c(10011, 10021, 10382, 11012))

WGCNA - error in modulePreservation(): duplicated row.names not allowed

I'm having some problems with the modulePreservation function of WGCNA (https://www.rdocumentation.org/packages/WGCNA/versions/1.63/topics/modulePreservation). When I use it with my multiData dataframes (gene expression from case and control groups), I'm having a error of duplicated row.names. In the past, I was able to perform this step with no problems at all.
(Ps. multiExpr = multiData ; control_colors = multiColor)
> modulePreservation(multiExpr, control_colors, dataIsExpr=T, referenceNetworks=1, nPermutations=100, randomSeed=1, quickCor=0, verbose=3, networkType="unsigned")
.checking data for excessive amounts of missing data..
Flagging genes and samples with too many missing values...
..step 1
Flagging genes and samples with too many missing values...
..step 1
..unassigned 'module' name: grey
..all network sample 'module' name: gold
..calculating observed preservation values
Error in `.rowNamesDF<-`(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘A1CF’, ‘A2M’, ‘AADAC’, ‘AARS’, ‘AASDHPPT’, ‘ABCA12’, ‘ABCA3’, ‘ABCA4’, ‘ABCA8’, ‘ABCB11’, ‘ABCB4’, ‘ABCB9’, ‘ABCC1’, ‘ABCC3’, ‘ABCC6’, ‘ABCD2’, ‘ABCD4’, ‘ABCE1’, ‘ABCF3’, ‘ABCG1’, ‘ABCG2’, ‘ABHD10’, ‘ABHD2’, ‘ABHD4’, ‘ABHD6’, ‘ABI2’, ‘ABL1’, ‘ABL2’, ‘ACAA2’, ‘ACACA’, ‘ACACB’, ‘ACAD10’, ‘ACAD8’, ‘ACADL’, ‘ACADSB’, ‘ACADVL’, ‘ACAN’, ‘ACAP1’, ‘ACAT1’, ‘ACBD3’, ‘ACBD4’, ‘ACCN3’, ‘ACD’, ‘ACE2’, ‘ACHE’, ‘ACIN1’, ‘ACO2’, ‘ACOT7’, ‘ACOT8’, ‘ACOT9’, ‘ACOX3’, ‘ACOXL’, ‘ACPP’, ‘ACR’, ‘ACRV1’, ‘ACSF2’, ‘ACSL3’, ‘ACSL5’, ‘ACSL6’, ‘ACSM3’, ‘ACTB’, ‘ACTC1’, ‘ACTL6B’, ‘ACTL7A’, ‘ACTL8’, ‘ACTN2’, ‘ACTN3’, ‘ACTR1A’, ‘ACTR2’, ‘ACTR3B’, ‘ACTR5’, ‘ACTR8’, ‘ACVR1’, ‘ACVRL1�� [... truncated]
I already checked the row.names and colnames of my multiExpr files, and all are unique values:
sum(duplicated(row.names(multiExpr$Control$data)))
sum(duplicated(row.names(multiExpr$Case$data)))
sum(duplicated(colnames(multiExpr$Control$data)))
sum(duplicated(colnames(multiExpr$Case$data)))
My R version is R version 3.5.1 (2018-07-02)
It seems to be a bug in signedKME()
I've proposed a fix at https://www.biostars.org/p/339950/

Import data into R - argument is empty

I am trying to use a R package called GOSemSim, it requires to import a lot of data into variables with a specific format like this:
data1 = c("one", "two", "three")
data2 = c("A", "B", "C")
When the list of data that I try to import into a variable is longer than 293 then I get the following error message:
argument 293 is empty
THere are no error with the "" or comma, I computed it with linux, it does not matter what data it is.
This is really weird basically, I tried on two computers with no luck. I tried to import it as a CSV file but the R package won't allow it.
Anyone knows why you cannot import more than 293 data?
Update:
Here is the code and my data at the same time, it is a one liner in R which has never been a problem for me!
OQ = c("GO:0000003", "GO:0000070", "GO:0000077", "GO:0000079", "GO:0000082", "GO:0000086", "GO:0000122", "GO:0000212", "GO:0000226", "GO:0000278", "GO:0000279", "GO:0000280", "GO:0000724", "GO:0000725", "GO:0000819", "GO:0000910", "GO:0001932", "GO:0002118", "GO:0002121", "GO:0002165", "GO:0003002", "GO:0003006", "GO:0006022", "GO:0006030", "GO:0006040", "GO:0006139", "GO:0006259", "GO:0006260", "GO:0006261", "GO:0006267", "GO:0006270", "GO:0006275", "GO:0006277", "GO:0006281", "GO:0006302", "GO:0006304", "GO:0006305", "GO:0006306", "GO:0006310", "GO:0006323", "GO:0006325", "GO:0006342", "GO:0006351", "GO:0006355", "GO:0006357", "GO:0006366", "GO:0006464", "GO:0006468", "GO:0006479", "GO:0006725", "GO:0006807", "GO:0006928", "GO:0006950", "GO:0006974", "GO:0006996", "GO:0007010", "GO:0007017", "GO:0007018", "GO:0007049", "GO:0007051", "GO:0007059", "GO:0007062", "GO:0007067", "GO:0007076", "GO:0007088", "GO:0007093", "GO:0007095", "GO:0007098", "GO:0007126", "GO:0007127", "GO:0007131", "GO:0007140", "GO:0007141", "GO:0007143", "GO:0007154", "GO:0007155", "GO:0007156", "GO:0007259", "GO:0007266", "GO:0007275", "GO:0007276", "GO:0007281", "GO:0007282", "GO:0007292", "GO:0007304", "GO:0007307", "GO:0007346", "GO:0007350", "GO:0007365", "GO:0007367", "GO:0007379", "GO:0007389", "GO:0007399", "GO:0007400", "GO:0007417", "GO:0007420", "GO:0007423", "GO:0007444", "GO:0007472", "GO:0007476", "GO:0007552", "GO:0007560", "GO:0008104", "GO:0008213", "GO:0008283", "GO:0008284", "GO:0008315", "GO:0008356", "GO:0009059", "GO:0009611", "GO:0009653", "GO:0009790", "GO:0009791", "GO:0009880", "GO:0009886", "GO:0009887", "GO:0009888", "GO:0009889", "GO:0009890", "GO:0009892", "GO:0009893", "GO:0009896", "GO:0009968", "GO:0009987", "GO:0010032", "GO:0010033", "GO:0010092", "GO:0010389", "GO:0010468", "GO:0010498", "GO:0010556", "GO:0010558", "GO:0010564", "GO:0010604", "GO:0010605", "GO:0010608", "GO:0010629", "GO:0010648", "GO:0010948", "GO:0014016", "GO:0014017", "GO:0014070", "GO:0016043", "GO:0016055", "GO:0016070", "GO:0016310", "GO:0016319", "GO:0016321", "GO:0016441", "GO:0016458", "GO:0016568", "GO:0016569", "GO:0016570", "GO:0016571", "GO:0016572", "GO:0017145", "GO:0018130", "GO:0019219", "GO:0019222", "GO:0019438", "GO:0019827", "GO:0019953", "GO:0022402", "GO:0022403", "GO:0022404", "GO:0022412", "GO:0022414", "GO:0022610", "GO:0023052", "GO:0023057", "GO:0030111", "GO:0030154", "GO:0030178", "GO:0030182", "GO:0030261", "GO:0030422", "GO:0030703", "GO:0030727", "GO:0031023", "GO:0031047", "GO:0031050", "GO:0031056", "GO:0031060", "GO:0031123", "GO:0031145", "GO:0031175", "GO:0031323", "GO:0031324", "GO:0031325", "GO:0031326", "GO:0031327", "GO:0031331", "GO:0031398", "GO:0031399", "GO:0031401", "GO:0031570", "GO:0031572", "GO:0031935", "GO:0032268", "GO:0032270", "GO:0032501", "GO:0032502", "GO:0032504", "GO:0032507", "GO:0032774", "GO:0032776", "GO:0032886", "GO:0033043", "GO:0033044", "GO:0033260", "GO:0033301", "GO:0033554", "GO:0034622", "GO:0034641", "GO:0034645", "GO:0034654", "GO:0034754", "GO:0034968", "GO:0035023", "GO:0035107", "GO:0035114", "GO:0035120", "GO:0035186", "GO:0035194", "GO:0035195", "GO:0035220", "GO:0035282", "GO:0035295", "GO:0035825", "GO:0036211", "GO:0036388", "GO:0040029", "GO:0042060", "GO:0042221", "GO:0042445", "GO:0043009", "GO:0043066", "GO:0043069", "GO:0043161", "GO:0043170", "GO:0043331", "GO:0043412", "GO:0043414", "GO:0043549", "GO:0043631", "GO:0043933", "GO:0044237", "GO:0044249", "GO:0044260", "GO:0044271", "GO:0044419", "GO:0044700", "GO:0044702", "GO:0044703", "GO:0044707", "GO:0044728", "GO:0044763", "GO:0044767", "GO:0044770", "GO:0044771", "GO:0044772", "GO:0044773", "GO:0044774", "GO:0044786", "GO:0044818", "GO:0044839", "GO:0044843", "GO:0044848", "GO:0045132", "GO:0045165", "GO:0045168", "GO:0045185", "GO:0045448", "GO:0045455", "GO:0045787", "GO:0045814", "GO:0045859", "GO:0045892", "GO:0045931", "GO:0045934", "GO:0046331", "GO:0046425", "GO:0046483", "GO:0046580", "GO:0046605", "GO:0046777", "GO:0048070", "GO:0048134", "GO:0048135", "GO:0048285", "GO:0048311", "GO:0048468", "GO:0048477", "GO:0048513", "GO:0048518", "GO:0048519", "GO:0048522", "GO:0048523", "GO:0048563", "GO:0048569", "GO:0048583", "GO:0048585", "GO:0048609", "GO:0048646", "GO:0048666", "GO:0048699", "GO:0048704", "GO:0048705", "GO:0048706", "GO:0048707", "GO:0048731", "GO:0048736", "GO:0048737", "GO:0048754", "GO:0048856", "GO:0048863", "GO:0048865", "GO:0048867", "GO:0048869", "GO:0050789", "GO:0050793", "GO:0050794", "GO:0050896", "GO:0051052", "GO:0051058", "GO:0051128", "GO:0051171", "GO:0051172", "GO:0051225", "GO:0051235", "GO:0051246", "GO:0051247", "GO:0051252", "GO:0051253", "GO:0051276", "GO:0051297", "GO:0051299", "GO:0051301", "GO:0051302", "GO:0051321", "GO:0051325", "GO:0051329", "GO:0051338", "GO:0051351", "GO:0051443", "GO:0051445", "GO:0051641", "GO:0051646", "GO:0051651", "GO:0051704", "GO:0051716", "GO:0051726", "GO:0051783", "GO:0051785", "GO:0060255", "GO:0060429", "GO:0060548", "GO:0060688", "GO:0060966", "GO:0060968", "GO:0060993", "GO:0061138", "GO:0065003", "GO:0065004", "GO:0065007", "GO:0070192", "GO:0070507", "GO:0070887", "GO:0070918", "GO:0071103", "GO:0071359", "GO:0071822", "GO:0071824", "GO:0071840", "GO:0071897", "GO:0071900", "GO:0072028", "GO:0072078", "GO:0072079", "GO:0072088", "GO:0080090", "GO:0090068", "GO:0090304", "GO:0090306", "GO:0098609", "GO:1901071", "GO:1901360", "GO:1901362", "GO:1901576", "GO:1901987", "GO:1901988", "GO:1901990", "GO:1901991", "GO:1902275", "GO:1902299", "GO:1902589", "GO:1902679", "GO:1902749", "GO:1903046", "GO:1903047", "GO:1903308", "GO:1903322", "GO:2000026", "GO:2000112", "GO:2000113", "GO:2001141")
The error message in itself is informative. If one tries to make it reproducible, it's best to work with small subsets. It usually helps to have a dead stare at your data before trying to reproduce the behavior. For example,
OQ = c("GO:0000003", "GO:2001141", )
Notice that there are two elements of this character vector. Or are they?
Error in c("GO:0000003", "GO:2001141", ) : argument 3 is empty
Number 3 is the key. R is expecting three elements. Notice the comma after the second element. Once you remove it, you'll be able to create the QQ variable. Scan your real example. I'm sure there's a , , somewhere.
EDIT
I tried copy/pasting your code into a script in Rstudio and it produced the error you describe. If you scroll right, you'll notice that syntax coloring is not working at around position 5000. I have folded the code so that it fits on screen and it runs fine.
This is how I folded the vector and it worked.
OQ = c("GO:0000003", "GO:0000070", "GO:0000077", "GO:0000079", "GO:0000082", "GO:0000086", "GO:0000122",
"GO:0000212", "GO:0000226", "GO:0000278", "GO:0000279", "GO:0000280", "GO:0000724", "GO:0000725",
"GO:0000819", "GO:0000910", "GO:0001932", "GO:0002118", "GO:0002121", "GO:0002165", "GO:0003002",
"GO:0003006", "GO:0006022", "GO:0006030", "GO:0006040", "GO:0006139", "GO:0006259", "GO:0006260",
"GO:0006261", "GO:0006267", "GO:0006270", "GO:0006275", "GO:0006277", "GO:0006281", "GO:0006302",
"GO:0006304", "GO:0006305", "GO:0006306", "GO:0006310", "GO:0006323", "GO:0006325", "GO:0006342",
"GO:0006351", "GO:0006355", "GO:0006357", "GO:0006366", "GO:0006464", "GO:0006468", "GO:0006479",
"GO:0006725", "GO:0006807", "GO:0006928", "GO:0006950", "GO:0006974", "GO:0006996", "GO:0007010",
"GO:0007017", "GO:0007018", "GO:0007049", "GO:0007051", "GO:0007059", "GO:0007062", "GO:0007067",
"GO:0007076", "GO:0007088", "GO:0007093", "GO:0007095", "GO:0007098", "GO:0007126", "GO:0007127",
"GO:0007131", "GO:0007140", "GO:0007141", "GO:0007143", "GO:0007154", "GO:0007155", "GO:0007156",
"GO:0007259", "GO:0007266", "GO:0007275", "GO:0007276", "GO:0007281", "GO:0007282", "GO:0007292",
"GO:0007304", "GO:0007307", "GO:0007346", "GO:0007350", "GO:0007365", "GO:0007367", "GO:0007379",
"GO:0007389", "GO:0007399", "GO:0007400", "GO:0007417", "GO:0007420", "GO:0007423", "GO:0007444",
"GO:0007472", "GO:0007476", "GO:0007552", "GO:0007560", "GO:0008104", "GO:0008213", "GO:0008283",
"GO:0008284", "GO:0008315", "GO:0008356", "GO:0009059", "GO:0009611", "GO:0009653", "GO:0009790",
"GO:0009791", "GO:0009880", "GO:0009886", "GO:0009887", "GO:0009888", "GO:0009889", "GO:0009890",
"GO:0009892", "GO:0009893", "GO:0009896", "GO:0009968", "GO:0009987", "GO:0010032", "GO:0010033",
"GO:0010092", "GO:0010389", "GO:0010468", "GO:0010498", "GO:0010556", "GO:0010558", "GO:0010564",
"GO:0010604", "GO:0010605", "GO:0010608", "GO:0010629", "GO:0010648", "GO:0010948", "GO:0014016",
"GO:0014017", "GO:0014070", "GO:0016043", "GO:0016055", "GO:0016070", "GO:0016310", "GO:0016319",
"GO:0016321", "GO:0016441", "GO:0016458", "GO:0016568", "GO:0016569", "GO:0016570", "GO:0016571",
"GO:0016572", "GO:0017145", "GO:0018130", "GO:0019219", "GO:0019222", "GO:0019438", "GO:0019827",
"GO:0019953", "GO:0022402", "GO:0022403", "GO:0022404", "GO:0022412", "GO:0022414", "GO:0022610",
"GO:0023052", "GO:0023057", "GO:0030111", "GO:0030154", "GO:0030178", "GO:0030182", "GO:0030261",
"GO:0030422", "GO:0030703", "GO:0030727", "GO:0031023", "GO:0031047", "GO:0031050", "GO:0031056",
"GO:0031060", "GO:0031123", "GO:0031145", "GO:0031175", "GO:0031323", "GO:0031324", "GO:0031325",
"GO:0031326", "GO:0031327", "GO:0031331", "GO:0031398", "GO:0031399", "GO:0031401", "GO:0031570",
"GO:0031572", "GO:0031935", "GO:0032268", "GO:0032270", "GO:0032501", "GO:0032502", "GO:0032504",
"GO:0032507", "GO:0032774", "GO:0032776", "GO:0032886", "GO:0033043", "GO:0033044", "GO:0033260",
"GO:0033301", "GO:0033554", "GO:0034622", "GO:0034641", "GO:0034645", "GO:0034654", "GO:0034754",
"GO:0034968", "GO:0035023", "GO:0035107", "GO:0035114", "GO:0035120", "GO:0035186", "GO:0035194",
"GO:0035195", "GO:0035220", "GO:0035282", "GO:0035295", "GO:0035825", "GO:0036211", "GO:0036388",
"GO:0040029", "GO:0042060", "GO:0042221", "GO:0042445", "GO:0043009", "GO:0043066", "GO:0043069",
"GO:0043161", "GO:0043170", "GO:0043331", "GO:0043412", "GO:0043414", "GO:0043549", "GO:0043631",
"GO:0043933", "GO:0044237", "GO:0044249", "GO:0044260", "GO:0044271", "GO:0044419", "GO:0044700",
"GO:0044702", "GO:0044703", "GO:0044707", "GO:0044728", "GO:0044763", "GO:0044767", "GO:0044770",
"GO:0044771", "GO:0044772", "GO:0044773", "GO:0044774", "GO:0044786", "GO:0044818", "GO:0044839",
"GO:0044843", "GO:0044848", "GO:0045132", "GO:0045165", "GO:0045168", "GO:0045185", "GO:0045448",
"GO:0045455", "GO:0045787", "GO:0045814", "GO:0045859", "GO:0045892", "GO:0045931", "GO:0045934",
"GO:0046331", "GO:0046425", "GO:0046483", "GO:0046580", "GO:0046605", "GO:0046777", "GO:0048070",
"GO:0048134", "GO:0048135", "GO:0048285", "GO:0048311", "GO:0048468", "GO:0048477", "GO:0048513",
"GO:0048518", "GO:0048519", "GO:0048522", "GO:0048523", "GO:0048563", "GO:0048569", "GO:0048583",
"GO:0048585", "GO:0048609", "GO:0048646", "GO:0048666", "GO:0048699", "GO:0048704", "GO:0048705",
"GO:0048706", "GO:0048707", "GO:0048731", "GO:0048736", "GO:0048737", "GO:0048754", "GO:0048856",
"GO:0048863", "GO:0048865", "GO:0048867", "GO:0048869", "GO:0050789", "GO:0050793", "GO:0050794",
"GO:0050896", "GO:0051052", "GO:0051058", "GO:0051128", "GO:0051171", "GO:0051172", "GO:0051225",
"GO:0051235", "GO:0051246", "GO:0051247", "GO:0051252", "GO:0051253", "GO:0051276", "GO:0051297",
"GO:0051299", "GO:0051301", "GO:0051302", "GO:0051321", "GO:0051325", "GO:0051329", "GO:0051338",
"GO:0051351", "GO:0051443", "GO:0051445", "GO:0051641", "GO:0051646", "GO:0051651", "GO:0051704",
"GO:0051716", "GO:0051726", "GO:0051783", "GO:0051785", "GO:0060255", "GO:0060429", "GO:0060548",
"GO:0060688", "GO:0060966", "GO:0060968", "GO:0060993", "GO:0061138", "GO:0065003", "GO:0065004",
"GO:0065007", "GO:0070192", "GO:0070507", "GO:0070887", "GO:0070918", "GO:0071103", "GO:0071359",
"GO:0071822", "GO:0071824", "GO:0071840", "GO:0071897", "GO:0071900", "GO:0072028", "GO:0072078",
"GO:0072079", "GO:0072088", "GO:0080090", "GO:0090068", "GO:0090304", "GO:0090306", "GO:0098609",
"GO:1901071", "GO:1901360", "GO:1901362", "GO:1901576", "GO:1901987", "GO:1901988", "GO:1901990",
"GO:1901991", "GO:1902275", "GO:1902299", "GO:1902589", "GO:1902679", "GO:1902749", "GO:1903046",
"GO:1903047", "GO:1903308", "GO:1903322", "GO:2000026", "GO:2000112", "GO:2000113", "GO:2001141")

Resources