Learn R Programming

translateSPSS2R (version 1.0.0)

computeReplace: Replace matched pattern in a string

Description

Helper Function for xpssCompute. R Implementation of the SPSS REPLACE Function.

Usage

computeReplace (x,pattern=NULL,match=NULL, count = NULL)

Arguments

x
input vector
pattern
pattern to look for
match
string tp replace with
count
number of occurencees of pattern to replace

Value

String. Returns a character vector

See Also

str_replace str_replace_all str_sub<-

Examples

Run this code
xpssCompute(x="Makfts sftnsft", fun="computeReplace",pattern="ft",match="e")

Run the code above in your browser using DataLab