Displaying 1 result from an estimated 1 matches for "haveaniceday".
2007 Jun 18
3
String manipulation, insert delim
...been using R for two years now and I am happy to say this is the
first time I could not find the answer to my problem in the R-help
archives. Here is the pending problem:
I want to be able to insert delimiters, say commas, into a string of
characters at uneven intervals such that:
foo<-c("haveaniceday")#my string of character
bar<-c(4,1,4,3) # my vector of uneven intervals
my.fun(foo,bar) # some function that places delimiters appropriately
have,a,nice,day # what the function would ideally return
I've tried multiple for-loops using cut and paste but have not had success.
Thanks!...