similar to: A "matching problem"

Displaying 20 results from an estimated 20000 matches similar to: "A "matching problem""

2003 Aug 26
3
matching-case sensitivity
Hi All, I am trying to match two character arrays (email lists) using either pmatch(), match() or charmatch() functions. However the function is "missing" some matches due to differences in the cases of some letters between the two arrays. Is there any way to disable case sensitivity or is there an entirely better way to match two character arrays that have identical entries but written
2008 Nov 08
4
missing value where TRUE/FALSE needed
Hello dear R people, for my MSc thesis I need to program some functions, and some of them simply do not work. In the following example, I made sure both vectors have the same length (10), but R gives me the following error: Error in if (vector1[i] == vector2[j]) { : missing value where TRUE/FALSE needed I googled for possible solutions, but I did not find a good explanation for this...
2012 Dec 14
5
A question on list and lapply
Dear all, let say I have following list: Dat <- vector("list", length = 26) names(Dat) <- LETTERS My_Function <- function(x) return(rnorm(5)) Dat1 <- lapply(Dat, My_Function) However I want to apply my function 'My_Function' for all elements of 'Dat' except the elements having 'names(Dat) == "P"'. Here I have specified the name
2005 Jun 20
3
vectorisation suggestion
Hi All, I am counting the number of occurrences of the terms listed in one vector in another vector. My code runs: for( i in 1:length(vector3)){ vector3[i] = sum(1*is.element(vector2, vector1[i])) } where vector1 = vector containing the terms whose occurrences I want to count vector2 = made up of a number of repetitions of all the elements of vector1 vector3 = a vector of NAs that is
2002 Jan 16
4
faster vector subtraction??
hi is there a faster way to do this? i <- 1 for(x in vector1) for(y in vector2) { m[[i]] <- (x - y) i <- i + 1 } regards soren -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in
2008 Jun 13
1
x86 SSE* Pointer Favors
Dear Statisticians--- This is not even an R question, so please forgive me. I have so much ignorance in this matter that I do not know where to begin. I hope someone can point me to documentation and/or a sample. I want to compute a covariance as quickly as non-humanly possible on an Intel core processor (up to SSE4) under linux. Alas, I have no idea how to engage CPU vectorization. Do I need
2005 Sep 09
2
Simulate phi-coefficient
Looking for help with the following problem. Given a sample of zeros and ones, for example: > VECTOR1<-rep(c(1,0),c(15,10)) > VECTOR1 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 How would I create a new sample (VECTOR2) also containing zeros and ones, in which the phi-coefficient between the two sample vectors was drawn from a population with a known
2010 Feb 02
1
Finding the difference between two vectors
Hello everyone, I have two vectors having only one element different: vector1 vector2 vector1 TWC TWC TWC VFC TWX NA VIA/B VFC VFC
2013 Sep 04
3
Fwd: Bienvenido a la lista de distribuciĆ³n R-help-es
Hola Jose, si CONCATENAR significa APILAR, es decir, concantenar verticalmente, por decirlo de algun modo, podrias hacerlo con rbind(): nuevovector <- rbind(vector1,vector2) Si ademas quieres que cada valor de los vectores originales sea identificado en el nuevovector, puedes usar: nuevovector <- stack(vector1,vector2) en este ultimo caso se agrega una columna adicional tipo factor, con
2009 Apr 03
1
Hello! I got error in C - R
Hello, My name is Ick Hoon Jin and I am Ph. D. student in Texas A & M Univ.. When I run the C embedded in R in the Linux system, I confront the following error after 6,000 iteration. By googling I found this error is from the problem in C. *** caught segfault *** address (nil), cause 'memory not mapped' My C code is following:
2010 Jan 30
2
parsing files for plot
Hi, I have many files containing one column of data. I like to use the scan function to parse the data. Next I like to bind to a large vector. I try this like: count<-1 files <- list.files() # all files in the working directory for(i in files) { tmp <- scan(i) assign(files[count], tmp) count<-count+1 } This part works! Now I like to plot the data in a boxplot.
2010 Jul 07
3
Need help in handling date
Dear all, I have a date related question. Suppose I have a character string "March-2009", how I can convert it to a valid date object like as.yearmon("2009-01-03") in the zoo package? Is there any possibility there? Ans secondly is there any R function which will give the names of of all months as "LETTERS" does? Thanks for your time. [[alternative HTML version
2013 Mar 04
3
A problem with text manipulation
Hello again, Let say I have following vector: set.seed(1) Vec <- sample(LETTERS[1:5], 10, replace = TRUE) Vec Now with each repeated letter, I like to add suffix programatically. Therefore I want to get following vector: c("B", "B1", "C", "E", "B2", "E1", "E2", "D", "D1", "A") Can somebody
2012 Dec 01
4
Getting all possible contingency tables
Hello all, Let say I have 2-way contingency table: Tab <- matrix(c(8, 10, 12, 6), nr = 2) and the Chi-squared test could not reject the independence: > chisq.test(Tab) Pearson's Chi-squared test with Yates' continuity correction data: Tab X-squared = 1.0125, df = 1, p-value = 0.3143 However I want to get all possible contingency tables under this independence
2012 Dec 18
7
Summarizing elements for a data.frame
Hello again, let say we have following data: Dat1 <- structure(list(factor.sample.LETTERS.1.3...6..replace...T.. = structure(c(1L, 3L, 2L, 1L, 3L, 3L), .Label = c("A", "B", "C"), class = "factor"), factor.sample.letters.1.2...6..replace...T.. = structure(c(2L, 2L, 1L, 1L, 2L, 1L), .Label = c("a", "b"), class =
2008 Jan 08
1
plotting help request II
Dear all, meanwhile i found out how to handle the coordinate thing and plot the lines like i like. the remaining problem is, i need something like names.arg does in barplot for my plot. my plot connects several dots with several lines. and now i like characters as the names of the intersects of the x-axis. vector1=c(a,b) vector2=c(c,d) # this vector makes sure the yellow line starts at
2017 Aug 23
4
Getting all possible combinations
Hi again, I am exploring if R can help me to get all possible combinations of members in a group. Let say I have a group with 5 members : A, B, C, D, E Now I want to generate all possible unique combinations with all possible lengths from that group e.g. 1st combination : A 2nd combination : B ..... 5th combination : E 6th combination : A, B 7th combination : B, C .... last combination: A, B,
2011 Nov 02
1
problem with merging two matrices
Dear all, I hope you can forgive me my stupid questions, but I am a very new R user (; So, this is my question: I have two matrices, those are: matrix1 <- matrix(cbind(vector1, vector2), 1,2, dimnames = list(c("values"), c("T value", "p value"))) matrix2 <- matrix(dcbind,2,6,dimnames =
2012 Dec 20
3
Problem loading .r file
Hello all, I was trying to load a .r file using source() and load() functions. Although I could be able to load the codes (mainly few user defined functions) written in that .r. file correctly, however getting following error: > source("D:/Book Code.r") Error in sys.call(sys.parent()) : node stack overflow > load("D:/Book Code.r") Error: bad restore file magic number
2013 Jan 24
2
Question on matrix calculation
Hello again, Ley say I have 1 matrix and 1 data frame: > mat <- matrix(1:15, 5) > match_df <- data.frame(Seq = 1:5, criteria = sample(letters[1:5], 5, replace = T)) > mat [,1] [,2] [,3] [1,] 1 6 11 [2,] 2 7 12 [3,] 3 8 13 [4,] 4 9 14 [5,] 5 10 15 > match_df Seq criteria 1 1 c 2 2 e 3 3 c 4 4 c 5