I have 2 dataframes with numeric codes that represent various jobs.
One df (df_a) has codes from census the other (df_b) has codes that represent essential jobs.
I need to create a new column in df_a with where jobs are listed as essential or non-essential based on codes in df_b.
The issue is that some job codes in df_a have character M = multiple integers in df_b (e.g. 123M5 in df_a = 12335, 12345, 12355... in df_b). I am trying to accomplish this by setting M='\\d' in df_a but not succeeding... any thoughts on a better way to approach this?
Thanks!
R function to substitute a character with any integer
78 Views Asked by learningR At
1
There are 1 best solutions below
Related Questions in R
- in R, recovering strings that have been converted to factors with factor()
- How to reinstall pandoc after removing .cabal?
- How do I code a Mixed effects model for abalone growth in Aquaculture nutrition with nested individuals
- How to save t.test result in R to a txt file?
- how to call function from library in formula with R type provider
- geom_bar define border color with different fill colors
- Different outcome using model.matrix for a function in R
- Creating a combination data.table in R
- Force specific interactions in Package 'earth' in R
- Output from recursive function R
- Extract series of observations from dataframe for complete sets of data
- Retrieve path of supplementary data file of developed package
- r package development - own function not visible for opencpu
- Label a dataset according to bins of a histogram
- multiply each columns of a matrix by a vector
Related Questions in BIOINFORMATICS
- Delete first line of all files in a folder (on ubuntu)
- With every loop iteration in Python use resulting file for subprocess call
- What might explain the [blastall] ERROR: Arguments must start with '-' error?
- In bioinformatics, what is a singleton?
- Coding genotypes from nucleotides to 0/1/2 in R (or Python)
- How to extract short sequence based on step size?
- Find Substring of Trie Keys
- Identify conserved sequences in lists of integers
- How to extract start and end sites based on capital letter in a sequence?
- getting records which are different from two fastq files
- choosing reads with Hamming distance zero
- Bash: Converting 4 columns of text interleaved lines (tab-delimited columns to FASTQ file)
- Unable to read an SBML file in SBMLR
- How to extract coordinates in P-match result?
- Repeated ordered sequence search algorithm
Related Questions in CENSUS
- R acs package - fetching county level data for all us only third of counties ouput
- Specifiying benchmark and vintage when batch geocoding with geocoding.geo.census.gov
- How to open Census Redistricting files?
- Error could not find function "call_geolocator_latlon" in trying to use tigris to get census tract codes
- Substr command in SAS not working how it's supposed to
- Is there any dataset or free API available to convert or find Congressional Districts from zipcode
- GEOID not found in TIGERLINE Shapefiles
- How to find census tract from latitude and longitude in python
- Trouble looping through function in R
- What is the code at the end of this 'address'
- How do I fix: Error in response$result$geographies$`2010 Census Blocks`[[1]] : subscript out of bounds for latitude/longitude data
- R function to substitute a character with any integer
- How do I qualify a SpatialPolygonsDataFrame using another SpatialPolygonsDataFrame?
- Census Data Using an API on R studio
- Accessing census acs5 median income block group data in python with acs5.get
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This might be what you need: