similar to: String Manipulation in R

Displaying 20 results from an estimated 10000 matches similar to: "String Manipulation in R"

2017 Jun 29
0
Different date formats in one column
I doubt your actual file looks like the mess that made it to my email software (below) because you posted HTML-format email. Read the Posting Guide, and in particular figure out how to send plain text email. You might try the "anytime" contributed package, though I suspect it too will choke on your mess. Otherwise, that will pretty much leave only a brute-force series of regular
2017 Jun 28
4
Different date formats in one column
Hi,? I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats: 02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014 I tried parse_date_time from lubridate library but it failed.Thanks so much.?Best,Farnoosh [[alternative HTML version deleted]]
2017 Jun 29
1
Different date formats in one column
Thanks Jeff. This is a nice way of solving this problem. What about the cases with 0015-02-21?Many thanks.?Best,Farnoosh On Wednesday, June 28, 2017 10:49 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: I doubt your actual file looks like the mess that made it to my email software (below) because you posted HTML-format email. Read the Posting Guide, and in particular
2012 Sep 28
3
Better way of Grouping?
Hello R users, This is more of a convenience question that I hope others might find useful if there is a better answer. I work with large datasets that requires multiple parsing stages for different analysis. For example, compare group 3 vs. group 4. A more complicated comparison would be time B in group 3 of group L with B in group 4 of group L. I normally subset each group with the
2018 Mar 05
2
Help with apply and new column?
Thanks. I think nabble is good for programming questions. Bear with me if I'm incorrect. Data: Genomics SNP information Goal: I need to add Chromosome and SNP position to the data frame I'm using through apply. I'd like to add new column from text processed through apply function. For example: 10:60523:T:G (Column 2) CHR: 10 Position: 60523 Dataset: chr rs ps n_miss allele1
2011 Oct 04
3
How to subset() from data frame using specific rows
I have a data frame called chemdata with this structure: > str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site : Factor w/ 148 levels "BC-0.5","BC-1",..: 104 145 126 115 114 128 124 2 3 3 ... $ sampdate: Date, format: "1996-12-27" "1996-08-22" ... $ param : Factor w/ 8 levels "As","Ca","Cl",..:
2018 Mar 05
0
Help with apply and new column?
Comments interspersed, and some code at the end. On Mon, 5 Mar 2018, Sariya, Sanjeev wrote: > Thanks. I think nabble is good for programming questions. Bear with me > if I'm incorrect. You may have found R-help archives at Nabble, but R-help has nothing to do with Nabble. > > Data: Genomics SNP information I know almost nothing about using R for genomics. > Goal: I need
2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all, I have a .csv file like below. Tool,Step_Number,Data1,Data2... etc up to 100 columns. A,1,0,1 A,2,3,1 A,3,2,1 . . B,1,3,2 B,2,1,2 B,3,3,2 . . ...... so on upto 50 rows where the column "*Tool*" has distinct steps in second column "*Step_Number*",but both have same entries in Step_Number column. I want the output like below.
2005 Nov 25
3
obtaining a ROC curve
Hello, I have a classification tree. I want to obtain a ROC curve for this test. What is the easiest way to obtain one? -Anjali --------------------------------- [[alternative HTML version deleted]]
2010 Oct 08
2
Memory management in R
Dear All, I am experiencing some problems with a script of mine. It crashes with this message Error in grepl(fut_string, past_string) : invalid regular expression
2012 Oct 26
4
Merge matrices with different column names
A general question that I have been pursuing for some time but have set aside. When finishing some analysis, I can have multiple matrices that have specific column names. Ideally, I would like to combine these separate matrices for a final output as a csv file. A generic example: Matrix 1 var1A var1B var1C x x x x x
2009 Jul 20
1
locate substring in the string it belong to
Hi R users, I am trying generate the indices for locating a in the string it come from. Given the length of the string, it will take too long using the combn() for further comparison. I am wondering if R has any built-in function for this purpose. To make it concrete: this.substring="cc" this.string="ccc" start.location=1,2 end.location=2,3 Thanks in advance, Kevin
2007 Oct 26
1
some xen issues
Hi , We are using Xen 4.0 version. These are the problems we are facing: 1) Centos-5 installed successfully from other installation media, Video card is detected but mouse is not working. 2) Centos-5 installed successfully from inbuilt template,but Video card is not been detected. 3) Debian 4.0 installed from other installation media, GUI is working but mouse is not working. 4) Debian 4.0
2006 May 17
1
Column notation
Hello, I would like to run a correlation on values in a table that has 4 rows and 136 columns. However, I am only interested in correlating the values in alternating blocks of 15 columns. For example, I would like to correlate the values in row 1, columns 2-16:31-46:61-76:91-106 with values in row 2, columns 2-16:31-46:61-76:91-106. Is there a way to notate this in the cor command so that the
2009 Nov 23
4
Check if string has all alphabets or numbers
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091123/470946bc/attachment-0001.pl>
2009 Dec 19
3
integer(0) and NA do not equal FALSE
Hi, A noobie question: I'm simply trying to run a conditional statement that evaluates if a substring is found within a larger string. I find that if it IS found, my function returns TRUE (great!), but if not, the condition does not evaluate to FALSE. ex): if( grep("hi", "hop", fixed = TRUE) ) print('yes, your substring is in your string') else
2010 Apr 03
2
Using ifelse and grep
Good Morning, I am trying to create a new column of character strings based on the first two letters in a string in another column. I believe that I need to use some combination of ifelse and grep but I am not totally sure how to combine them. I am not totally sure why the command below isn't working. Obviously it isn't finding anything that matches my criteria but I am not sure why. Any
2009 Jul 19
1
trouble using optim for maximalisation of 2-parameter function
Hello, I am having trouble using "optim". I want to maximalise a function to its parameters [kind of like: univariate maximum likelihood estimation, but i wrote the likelihood function myself because of data issues ] When I try to optimize a function for only one parameter there is no problem: llik.expo<-function(x,lam){(length(x)*log(lam))-(length(x)*log(1-exp(-1*lam*
2000 Jul 11
2
parsing dir output for file sizes
I've got an R wrapper around an old DOS program. In the R program I need to test whether the DOS program failed to produce certain output. This is indicated by certain text files created by the DOS program being empty. I can use system(command, intern=TRUE) to get the output of a DOS dir for a test file, but I'm having trouble parsing this to get the file size. Is there an R function
2004 Dec 05
2
String manipulation---mixed case
Hello, Does anyone know of a "slick" way to get R to convert a string which is all upper case to a string where the first letter in each word is upper case and all others are lower case? I suspect the solution is to begin by parsing the string, convert the appropriate letters to upper and lower case using "toupper" and "tolower", and then to paste the pieces back