similar to: Removing "+" and "?" signs

Displaying 20 results from an estimated 10000 matches similar to: "Removing "+" and "?" signs"

2009 Nov 20
2
Finding & replacing non-ASCII characters
Hi guys, Are there any feasible methods in searching & finding non-ASCII characters in R? For example, from the following object, x <- mia. SzaÌmitaÌó The desired output is, x.out <- mia. SzaImitaIA Your help in resolving this would be greatly appreciated. [[alternative HTML version deleted]]
2009 May 21
4
Re placing a "+" in a string
I know this is easy, but I am stumped: > gsub("0","K","8.00+00") [1] "8.KK+KK" > gsub("+","K","8.00+00") Error in gsub("+", "K", "8.00+00") : invalid regular expression '+' In addition: Warning message: In gsub("+", "K", "8.00+00") : regcomp error:
2009 Aug 27
5
Help on efficiency/vectorization
Dear R users, I am trying to extract the rownames of a data set for which each columns meet a certain criteria. (condition - elements of each column to be equal 1) I have the correct result, however I am seeking for more efficient (desire vectorization) way in implementing such problem as it can get quite messy if there are hundreds of columns. Arbitrary data set and codes are shown below for
2010 Aug 04
1
Carriage return character issue
Hi all, I imported a file (in CSV format) into R for processing, then imported the result into MySQL. However, there are *carriage return* characters (hexadecimal: *0D*) that are appended to the characters in the last field of the table. i.e *\r* appended to the character values (as shown below) Before importing into MySQL: asdf After importing into MySQL: asdf*\r* ** ** Are there any options
2011 Dec 01
2
Counting the occurences of a charater within a string
I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. My dataframe, x, is structured as below: Col1 abc/def ghi/jkl/mno I found this code on the board but it counts all occurrences of "/" in the dataframe. chr.pos <- which(unlist(strsplit(x,NULL))=='/') chr.count <-
2009 Aug 25
2
Removing objects from workspace
Hi all, I am currently woking with hundreds of objects in workspace and whenever I invoke ls() to observe the names of the objects, there are too much of unnecessary variables. For example, if I only require say 3 or 4 objects from hundreds of objects in workspace, are there any methods that may do the job? I have tried rm(-c(x,xx,xxx)), but no luck.. Your feedback in this problem would be
2009 Sep 10
2
"Read.csv" in R with dynamic file (1st) argument
Dear R users, I have numerous data sets (csv files) saved in the folder which has the same name as individual data. (i.e data x1 saved in x1 folder, data x2 in x2 folder etc) I would like to read in the desired data set name using 'scan' function and assign this inputted value to an object so that it can be used in the 'read.csv' function. For example, x <- scan() 1: 0708
2005 Jan 31
2
Extracting a numeric prefix from a string
Hi Does anyone know if there is a function similar to as.numeric that will extract a numeric prefix from a string as in the following examples? x<-c(3, "abc", 5.67, "2.4a", "6a", "6b", "2.4.a", 3, "4.2a") df.x<-data.frame(Code=x) x.str<-levels(df.x[,1]) # required function result 2.40 3.00 4.20 5.67 6.00 NA Thanks Mike White
2010 Jul 16
2
Storing processed results back into original objects
Hi all, There are matrices with same column names but arranged in different orders and I desire columns of these matrices to have same order. For example, below are 2 arbitrary data sets with columns arranged in different order. I require columns of these to have same order as specified in "columns" object and the results stored in the original object names. I know this can be done
2008 Apr 09
2
autocompletion problem
Hi, Let's create the xxx object just to avoid confusion even if it's not necessary for reproducing the problem below: xxx <- 8:3 If I start typing this: max(xxx[ and now try to autocomplete with <TAB>, then I get the following error (and a warning): > max(xxx[Error in grep(sprintf("^%s", makeRegexpSafe(text)), allArgs, value = TRUE) : invalid
1998 Jun 26
2
R-beta: Problem with functions using sub and gsub
Previously I had problems with data(foo) and Gass and I had problems with help(). His diagnostic was "POSIX regular expressions not available" and mine was "invalid regular expression". Martin Maechler has no problems with Solaris 2.5 and suggested a regular expression library was needed, e.g., regex-x.xx. Solaris 2.4 has regex.o in /usr/ccs/libgen.a and regex.h in
2009 Jan 21
1
Bug in sub and gsub (PR#13460)
Full_Name: Leon C. Banza Version: 2.8.1 OS: Windows Vista Submission from: (NULL) (195.69.243.253) I believe there is a serious bug in the code for sub and gsub. I do as following: gsub("\\", "-", "some\\backslashed\\string") This ought return "some-backslashed-string", but prints warnings instead: Error in sub("\\", "",
2010 Sep 29
2
String split and concatenation
Hi R users, I desire to transform the following vector consisting of repeated characters x <- rep(letters, 3) into this exact format (i.e a single string containing each characters in quotation mark separated by comma between each; al ). ("a", "b", "c", "d", ........"a", "b", "c", "d", ...........,
2010 Jan 24
2
Creating directories & folders
Dear R users, I would like to create the following 3 folders (FUND1, FUND2, MARINE) within the 'parent.dir' as defined below. FUND1 <- "FD1 Q4 2009" FUND2 <- "FD2 Q4 2009" MARINE <- "MARINE Q4 2009" parent.dir <- "D:/....................." folders <- c("FUND1", "FUND2", "MARINE") for (i in
2010 Jan 05
2
Dynamic arguments in "rbind" function
Hi, all Basically, I have unknown number of data that need to be imported and collapsed row-wisely. The code below works fine, however the "rbind" function may require 50 arguments if there are 50 data files... Thus, I would like to explore whether there are any methods in using dynamic objects (i.e from the resulting objects in the for loop) as an argument in the *"rbind"*
2009 Sep 11
2
Accumulating results from "for" loop in a list/array
Dear R users, I would like to accumulate objects generated from 'for' loop to a list or array. To illustrate the problem, arbitrary data set and script is shown below, x <- data.frame(a = c(rep("n",3),rep("y",2),rep("n",3),rep("y",2)), b = c(rep("y",2),rep("n",4),rep("y",3),"n"), c =
2009 Sep 15
1
Header names when importing csv/excel data sets
Dear R users, Suppose the csv file contains header names such as *"Nike, dunk"*, *"Converse, All stars"* etc When imported to R (with header = T option), the column names are given by: *"Nike..dunk"* *"Converse..All.stars"* I have tried the following command to convert these column names to the original names as in the input source.
2010 Jun 16
1
"Write.table" problem
Hi all, I have imported csv file for processing and exported as txt file (using * "write.table"* with sep = "\t", row.names = FALSE options) However, when I import this txt file in R (*"read.delim"* with header = TRUE, sep = "\t" options) the dimension (i.e number of rows) is inconsistent with the original file. Any solution to this problem would be
2010 Mar 10
1
Generating records from data frame
Hi all, I wish to generate additional records according to one of the field values in a data frame. For example, unique record from the input data is required to be generated number of times as specified in the 'Number' field in the following code. > x <- data.frame(Name = c("a", "b", "c", "d"), Group = c("VR", "MR",
2004 Oct 28
1
gsub() on Matrix
Hi, Suppose I've got a matrix, and the first few elements look like "x1 + x3 + x4 + x5 + x1:x3 + x1:x4" "x1 + x2 + x3 + x5 + x1:x2 + x1:x5" "x1 + x3 + x4 + x5 + x1:x3 + x1:x5" and so on (have got terms from x1 ~ x14). If I want to replace all the x1 with i7, all x2 with i14, all x3 with i13, for example. Is there an easy way? I tried to put what I want