similar to: matching a sequence in a vector?

Displaying 20 results from an estimated 400 matches similar to: "matching a sequence in a vector?"

2012 Aug 28
4
Search for locations of subsequences?
Is there a function to efficiently search for a subsequence within a vector? For example, with x <- 1:100 I'd like to search for the sequence c(49,50,51), and be told that it occurs exactly once, starting at location 49. (The items in the vectors might be numeric or character, and there might be repetitions within the search pattern or within the vector I'm searching.) Duncan
2011 Oct 13
3
nls: singular convergeance
Dear R-experts, I have 28 data points that I would like to fit with a non linear broken-stick -- with three fitted parameters. When I view trace -- and use the final values as lines on the graph of data -- it looks pretty good. Q1. Why am I getting singular convergeance? Q2. Can you suggest another approach that may prove more satisfying? I have read previous examples on nls and this sort of
2000 Jul 17
3
Fonts and Line widths
Hi All R guru's, A couple of simple questions which I cannot find answers to in "an introduction to R" or in the reference manuals. I am running R on Win95, and have plotted up quite a nice box and whisker plot: char<-read.table("n:/reddinm/grifpr~1/survey/char.txt") attach(char) boxplot(Al,Fe,OC,pH, range=0,xaxis=FALSE, ylab="Proportion of Unirigated
2001 Jan 11
2
Bootstrapping
HI All, I am trying to analyse the results of a heap of samples, to determine how many samples are required to meet a defined confidence interval. I checked out the R manual for bootstrapping and re-sampling methods, but did not find anything. Are there any contributed procedures that deal with this? thanks, Matt Redding Soil Scientist Intensive Livestock Environmental Management-Research
2011 May 13
2
Creating dataframes
I would like to create a certain number of dataframes out of one dataframe where each of the dataframes is related to a factor. This should be possible with a loop or a function, as is very clumsy to do it manually when there are quite a lot factors. For example having a dataframe called "exmpl": Site Value 1 12 1 15 1 18 1 21 1 12 1 13 2 15 2 12 2 58 2 62 2 22 2 65 2 29 3 21 3 55
2011 May 19
2
Converting the graphics window to a data matrix
I'm wondering if anyone is aware of a way to take what is visible in the R graphics window, pixelate it, and express that pixellation in a numeric matrix. For example, I am using the following command to create a black (present) and white (absent) spatial simulation of grass tussock distribution. > symbols(x=runif(100,-.5,1.5),y=runif(100,-.5,1.5),circles=runif(100)/30,
2003 Jul 15
2
R, geochemistry, ternary diagrams
I'm in e-mail contact with a geochemist who maintains a well regarded geochemistry web site. He's drawing diagrams either with a Turbo Pascal program running in a DOS window or with Excel. I'm trying to persuade him that R would be a better choice. Something he's particularly keen on is ternary diagrams. I think he is talking about ternary phase diagrams, and if so, it looks as
2002 Nov 14
1
Redirecting Output to Clipboard
Hi R Gurus, I have a question that some of you may have dealt with before. I would redirect output to the clipboard, rather than to the screen. Is this possible? Is a function already written for it, or is it just an option in print? Any help would be appreciated. Also, thanks to all those who have helped develop this great software, or who make the effort here to support the user-base.
2008 Sep 21
2
Variable Selection for data reduction and discriminant anlaysis
Hello all, I'm dealing with geochemical analyses of some rocks. If I use the full composition (31 elements or variables), I can get reasonable separation of my 6 sources. Then when I go onto do LDA with the 6 groups, I get excellent separation. I feel like I should be reducing the variables to thos that are providing the most discrimination between the groups as this is important
2007 Dec 06
2
Segmented regression
Hello all, I have 3 time series (tt) that I've fitted segmented regression models to, with 3 breakpoints that are common to all, using code below (requires segmented package). However I wish to specifiy a zero coefficient, a priori, for the last segment of the KW series (green) only. Is this possible to do with segmented? If not, could someone point in a direction? The final goal is to
2003 Mar 25
2
Re: Bar plot with variable width (down a drill hole) - now missing intervals?
Hi again, Thanks Ted and Marc its works. But of course after pulling in in some real life data I discoverd one hitch. Often there are missing intervals. For example: from <- c(0, 1.2, 4.0, 4.2, 5.0, 25.0, 30.1, 45) to <- c(1.2, 4.0, 4.2, 5.0, 25, 30.1, 36.2, 50) intensity <- c(0, 1, 3, 2, 1, 0, 2, 5) barplot(intensity, width = -(to - from), space = 0, horiz = TRUE, ylim =
2006 Feb 22
4
Rails in Brisbane, Australia
Hi Any Rails developers from Brisbane, Australia? Any companies from Brisbane developing Rails applications? -- Aneesha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060222/cce3b491/attachment.html
2000 Dec 08
1
Sans Serif Fonts?
Hi All, I am preparing a few plots for publication. Unfortunately the journal requires figures to have all text in a sans serif fonts. I realise that there is support for the use of Hershey vector fonts in the function TEXT, but how do I get the text on axes to be sans serif? For example, the labels and axis values produced from this line of code: plot(SolPC, SorbPC, ylab="Sorbed P
1998 Sep 23
9
managing users from smbpasswd rather than /etc/passwd
I have samba installed on a web server (behind a firewall). It's working fine with all the WINS networking here (eg, password authentication from the NT servers, etc). I (we) want this web server - a linux redhat 5.x box currently running samba-1.9.18p8 - to have as few actual unix login accounts as possible. What I want/need to do is to allow LOTS of people in the faculty here
2020 Oct 29
1
R: sim1000G
Hi, I am using the sim1000G R package to simulate data for case/control study. I can not figure out how to manipulate this code to be able to generate 10% or 50% causal SNPs in R. This is whole code provided as example on GitHub: library(sim1000G) vcf_file = "region-chr4-357-ANK2.vcf.gz" #nvariants = 442, ss=1000 vcf = readVCF( vcf_file, maxNumberOfVariants = 442 ,min_maf =
2013 Jan 18
4
cambiar ciertos nombres de data.frame
Hola todos. Tengo un data. frame al que le quiero cambiar el nombra a alguna de sus columnas. Por ejemplo: >seba <- data.frame("constante"=1,"numeros"=1:10, "letras"=LETTERS[A:Z]) Listo sus nombres: >names(seba) [1] "constante" "numeros" "letras" Quiero que la columna que tiene el nombre "constante" pase a
2008 Oct 15
4
strsplit and regex
Hi All, Is there a means to extract the "10" from "23:10:34" in one pass using strsplit (or something else)? tst <- "23:10:34" For example my attempt strsplit(as.character(tst),"^[0-9]*:") gives [[1]] [1] "" "" "34" Obviously it is matching the first two instances of [0-9]. Note that there may be only one digit
2000 Jul 17
0
Fonts and Line widths in boxplot
> Hi All R guru's, > > A couple of simple questions which I cannot find answers to in "an > introduction to R" or in the reference manuals. > > I am running R on Win95, and have plotted up quite a nice box and whisker > plot: > > char<-read.table("n:/reddinm/grifpr~1/survey/char.txt") > attach(char) > boxplot(Al,Fe,OC,pH,
2000 Sep 14
0
Repeated Measures?
HI There, I was wondering if there was a procedure in R for carrying out greenhhouse geiser type repeated measures analysis and ante-dependence testing? I've checked out the nicely written manuals, but it seems to lack an entry in the index (maybe because this technique has not been implemented yet). THanks, Matt Redding Soil Scientist Intensive Livestock Environmental Management-Research
2000 Sep 17
1
Repeated Measures
Hi R Gurus, I am more or less a beginner with R. I have searched your FAQ, manuals, and the archives of this list for an answer to this question, unsuccessfully. I commonly do analysis of chemical characteristics of soils, by depth intervals (e.g. 0-100 mm, 100-200, 200-300, etc), comparing two soil profiles that have received some treatment (effluent). In Genstat I can handle this problem