similar to: Select elements from text

Displaying 20 results from an estimated 2000 matches similar to: "Select elements from text"

2012 Nov 01
7
Reduce(paste, x) question
I have a question about the Reduce function: x <- list() x[[1]] <- LETTERS[1:5] x[[2]] <- LETTERS[11:15] Reduce(paste, x) [1] "A K" "B L" "C M" "D N" "E O" How do I get this?: [1] "A" "K" [2] "B" "L" [3] "C" "M" [4] "D" "N" [5] "E" "O"
2012 Jul 06
2
Maximum number of patterns and speed in grep
Hi, I am using R's grep function to find patterns in vectors of strings. The number of patterns I would like to match is 7,700 (of different sizes). I noticed that I get an error message when I do the following: data <- array() for (j in 1:length(x)) { array[j] <- length(grep(paste(patterns[1:7700], collapse = "|"), x[j], value = T)) } When I break this up into 4 chunks of
2012 Jul 16
2
Finding and manipulation clusters of numbers in a sequence of numbers
Hi, I have the following sequence: in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2) >From this sequence I would like to get to the following sequence: out <- c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 2, 0, 2, 0, 0, 2) Basically,
2012 May 25
1
evaluate whether function returns error
Hi, The following returns an error message. How do I evaluate (TRUE or FALSE) the function? require(XML) readHTMLTable("http://www.sec.gov/Archives/edgar/data/2969/000095012399010952/0000950123-99-010952.txt") Thanks in advance! Math -- View this message in context: http://r.789695.n4.nabble.com/evaluate-whether-function-returns-error-tp4631406.html Sent from the R help mailing list
2012 May 30
1
gsub/strsplit with multiple patterns/splits
Hi, I have a vector like this: DF <- c("Aetna, Inc.", "Alexander's Inc.", "Allegheny Energy, Inc") For each element in the vector I would like to remove the "incorporated" info, so that my vector looks like this: DF <- c("Aetna", "Alexander's", "Allegheny Energy") That means that I have to strip: strip <-
2012 Nov 27
1
Accumulate objects in list after try()
Hi, I have written a function "harvest" and I would like to run the function for each value in a vector c(1:1000). The function returns 4 list objects (obj_1, obj_3, obj_3, obj_4) using the following code at the end of the function: return(list(obj_1 = obj_1, obj_2 = obj_2, obj_3 = obj_3, obj_4 = obj_4)). Since I am connecting with the web in the function and the connection sometimes
2010 Dec 10
2
Projecting data on a world map using long/lat
Hi, I have a dataset (CSV) with some counts of firms located around the globe. Each count is assigned to the longitude and latitude of the specific location. Now I want to plot these counts on a world map using dots (size of dots represent the count). I have been unable to find any info on whether this is possible and if so, how? Can you please help me? Thanks! Mathijs -- View this message
2011 Jun 02
2
Counting occurrences in a moving window
Hi list, based on the following data.frame I would like to create a variable that indicates the number of occurrences of A in the 3 years prior to the current year: DF = data.frame(read.table(textConnection(" A B 8025 1995 8026 1995 8029 1995 8026 1996 8025 1997 8026 1997 8025 1997 8027 1997 8026 1999 8027 1999 8028 1995 8029 1998 8025 1997 8027 1997 8026 1999 8027 1999
2010 Dec 09
2
Error in vector("integer", length) : vector size cannot be NA
Hello, I have uploaded a csv file that looks like this: > gc alpha_id beta_id 1 142053 1 2 9454 1 3 295618 2 4 42691 2 5 389224 3 6 9455 3 The alpha_id contains 310660 unique values and the beta_id contains 17431 unique values. The number of rows adds up to more than 1.3 million. Now I want to convert
2010 Dec 10
3
Delete observations with a frequency < x
Hi, I have two columns with data (both identifiers - it's an affiliation list) and I would like to delete the rows in which the observations in the second column have a frequency < 5 in the entire second column. Example: 1 a 1 b 1 c 2 a 2 b 2 d Let's say, I would like to delete the rows in which the observation in the second column has a frequency < 2 in
2012 Mar 14
4
Merging fully overlapping groups
Hi, I have data on individuals (B) who participated in events (A). If ALL participants in an event are a subset of the participants in another event I would like to remove the smaller event and if the participants in one event are exactly similar to the participants in another event I would like to remove one of the events (I don't care which one). The following example does that however it
2012 Mar 16
1
ggplot axis limit
Hi, This is probably an easy one, but I am new to ggplot2 and cannot find an answer online. I am bar plotting values of 10 groups. These values are all within a 90-100 range, so I would like leave out the area of the bars below 90. If I say "graph + scale_y_continuous(limit=c(90, 100))", it does limit the axis but the bars disappear completely. Any solution here? Thanks a lot!
2011 Feb 25
4
Error
Hi, I am running the following script for a different (much larger data frame): DF = data.frame(read.table(textConnection(" A B C D E 1 1 a 1999 1 0 2 1 b 1999 0 1 3 1 c 1999 0 1 4 1 d 1999 1 0 5 2 c 2001 1 0 6 2 d 2001 0 1 7 3 a 2004 0 1 8 3 b 2004 0 1 9 3 d 2004 0 1 10 4 b 2001 1 0 11 4 c 2001 1 0 12 4 d 2001 0
2010 Dec 21
1
Matching 2 SQL tables
Hi, I have a postgresql and a mysql database and I would like to combine the info from two different tables in R. Both databases contain a table with three columns: project_name, release_id and release_date. So each project output could be released multiple times (I am interested in the first release_date). However, some of the data is missing. Basically, what I want to do is to try and fill the
2011 Apr 09
5
Yearly aggregates and matrices
Hi, I need to perform calculations on subsets of a data frame: DF = data.frame(read.table(textConnection(" A B C D E F 1 a 1995 0 4 1 2 a 1997 1 1 3 3 b 1995 3 7 0 4 b 1996 1 2 3 5 b 1997 1 2 3 6 b 1998 6 0 0 7 b 1999 3 7 0 8 c 1997 1 2 3 9 c 1998 1 2 3 10 c 1999 6 0 0 11 d 1999 3 7 0 12 e 1995 1 2 3 13 e 1998 1 2 3 14 e 1999 6
2012 Jul 26
5
Auto logging-out client
Hi list! I'm writing because of an issue I'm having with my Postfix-Dovecot installation. Everything's working fine but when an IMAP client is idle for some time, Dovecot automatically logs it out. Jul 26 14:01:16 mail dovecot: imap(nicolas at devels.es): Disconnected: Logged out bytes=1271/7439 This entails errors when trying to send e-mails after this auto logout, such as:
2011 Apr 29
4
For loop and sqldf
Hi list, Can anyone tell my why the following does not work? Thanks a lot! Your help is very much appreciated. DF = data.frame(read.table(textConnection(" B C D E F G 8025 1995 0 4 1 2 8025 1997 1 1 3 4 8026 1995 0 7 0 0 8026 1996 1 2 3 0 8026 1997 1 2 3 1 8026 1998 6 0 0 4 8026 1999 3 7 0 3 8027 1997 1 2 3 9 8027 1998 1 2 3 1 8027 1999
2011 Aug 25
3
Selections in lists
Hi, I have produced a list g and I would like to reduce the amount of information contained in each object in g. For each matrix I would like to keep the values where the column name equals g[year][[1]][[x]] and the row names equals g[year][[1]][[-x]]. So in g$`1999`$`8029`, year = 1999 and x = 8029. I have been experimenting with the subset function, but have been unsuccesful. Thanks for your
2014 Jul 01
1
multiples domains or PDCs in samba
Hello, I'm Nicol?s from Uruguay, I work in ASSE (public health services), the enterprise has lots of buildings all over my country, more than 100, with thousands of employees and PCs. Until now there is no "network configuration" in PCs (no network users, etc) and I'm trying to solve that out. I started working with samba about one year ago (I've been learning a lot), I
2005 Jun 23
4
Monitoring Sirrix quad BRI channels
Hi all, How are things going ? Is there a way for me to individually identify each BRI channel on the Sirrix quad BRI board. The reason I ask is because our client uses the "Asterisk Flash Operator Panel" to monitor its external lines and transfer calls from the lines to the various SIP phones. The "Flash Operator Panel" requires that we set a static value for each line or