• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#windowsobjective-ccocoaqtpython誰得phprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión4f3eb7ddb68f90e9058456698dccd1be05274b5a (tree)
Tiempo2023-01-11 20:53:12
AutorLorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I added a function to insert a character in a string at a given position.

Cambiar Resumen

Diferencia incremental

diff -r 6e3c7688b546 -r 4f3eb7ddb68f R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Wed Jan 11 09:16:51 2023 +0100
+++ b/R-codes/stat_lib.R Wed Jan 11 12:53:12 2023 +0100
@@ -7016,4 +7016,11 @@
70167016
70177017 }
70187018
7019-
7019+## See https://statisticsglobe.com/insert-character-pattern-in-string-r
7020+
7021+insert_char <- function(x, pos, insert) { # Create own function
7022+ gsub(paste0("^(.{", pos, "})(.*)$"),
7023+ paste0("\\1", insert, "\\2"),
7024+ x)
7025+}
7026+