desc_fix: Find and replace text in an existing variable description...

Description Usage Arguments Details Author(s)

View source: R/desc_fix.R

Description

Use the "find" arguments to identify a string of text to be overwritten the "replace" argument. Include this function in a loop to quickly replace text in several documents.

Usage

1
2
3
4
5
6
7
8
9
desc_fix(
  path_or_variable,
  find_text,
  replace_text,
  find_name,
  replace_name,
  write = T,
  open_on_write = F
)

Arguments

path_or_variable

Character: Either a full path to a description file or the variable name associated with a description file currently in the PMA variables folder

find_text

A string of text to find in the desc file

replace_text

A string of text to replace find_text

find_name

Text to find in the variable name only

replace_name

Text to replace from find_name; if find_name is not provided, the entire variable name will be replaced. The new file will be renamed accordingly.

write

Logical: defaults TRUE. Use FALSE to only preview (this preview will also appear if TRUE).

open_on_write

Logical: defaults FALSE. If TRUE, file will open in Word (or default txt reader) via system call.

Details

As with desc_make, the output of this function will be .doc for mac users, but .txt for windows users (these must be manually saved as .doc files). This may be changed in future updates (when Matt learns how to use pandoc).

Author(s)

Matt Gunther


mgunther87/ipumsPMA documentation built on Aug. 1, 2020, 12:22 a.m.