similar to: multiple assignments ?

Displaying 20 results from an estimated 2000 matches similar to: "multiple assignments ?"

2004 Jul 09
3
Problem with bwplot
Try factor(vec2) in your bwplot() call. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Ernesto Jardim Sent: Friday, July 09, 2004 9:41 AM To: Mailing List R Subject: [R] Problem with bwplot Hi, I'm ploting some box-and-whisker plots with bwplot but I'm not getting any box-and-whiskers ... just dots.
2012 May 04
1
Equality of multiple vectors
Hello, I'm writing a piece of code where I need to compare multiple same length vectors. I've gone through the basic functions like identical() or all(), but they only work for comparing 2 vectors. From 3 vectors on, it doesn't work . Example: Assuming vec1 <- c (1,2,3,4,5) vec2 <- c(1,2,3,4,5) vec3 <- c(1,2,3,4,4) identical (vec1,vec2,vec3) returns TRUE, since the 2
2007 Feb 01
2
Losing factor levels when moving variables from one context to another
Hi, there I'm currently trying to figure out how to keep my "factor" levels for a variable when moving it from one data frame or matrix to another. Example below: vec1<-(rep("10",5)) vec2<-(rep("30",5)) vec3<-(rep("80",5)) vecs<-c(vec1, vec2, vec3) resp<-rnorm(2,15) dat<-as.data.frame(cbind(resp, vecs))
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Hi all, I’ve narrowed down a problem in my code to the following test case: - - - - typedef struct {float v[2];} vec2; typedef struct {float v[3];} vec3; vec2 getVec2(); vec3 getVec3() { vec2 myVec = getVec2(); vec3 res; res.v[0] = myVec.v[0]; res.v[1] = myVec.v[1]; res.v[2] = 1; return res; } - - - - Compiling this with any level of optimization for arm64 gives incorrect code,
2013 Jun 18
1
transform 3 numeric vectors empty of 0/1
Dear all, Without a loop, I would like transform 3 numeric vectors empty of 0/1 of same length Vec1 : transform 1 to A and 0 to "" Vec2 : transform 1 to B and 0 to "" Vec3 : transform 1 to C and 0 to "" to obtain only 1 vector Vec who is the paste of the 3 vectors (Ex : ABC, BC, AC, AB,...) Any idea ? Thank you for your help -- Michel ARNAUD
2011 Oct 01
2
Returning vector of values shared across 3 vectors?
Help-Rs,   I've got three vectors representing participants:   vec1 <- c(4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81) vec2 <- c (1,2,3,4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66) vec3 <- c (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,52)   I'd
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Thanks Bruce. > On 4 May 2015, at 13:18, Bruce Hoult <bruce at hoult.org> wrote: > > I can confirm that, with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) > > Very strange! Yes, that’s what I thought. I’ve also checked the binary downloads for OS X from llvm.org <http://llvm.org/> and get the same broken code from both the 3.5.2 and 3.6.0 releases.
2010 Feb 02
1
Build a matrix from another matrix by specifying the indexes
Hello R specialists, I have a base vector called vBase with 102 elements. I have another vector vec1 which elements are only part of vBase but is shorter. I transform vec1 so I get a vector with the same size as vBase and with each common element on the same indexed row. If a value is missing in vec1 then I put a Na like this: vec1 vBase Amsterdam Amsterdam Na
2012 Aug 24
6
updating elements of a vector sequentially - is there a faster way?
I would like to know whether there is a faster way to do the below operation (updating vec1). My objective is to update the elements of a vector (vec1), where a particular element i is dependent on the previous one. I need to do this on vectors that are 1 million or longer and need to repeat that process several hundred times. The for loop works but is slow. If there is a faster way, please let
2009 Jun 22
2
Help on creating a sequence of vectors
I want to create a number of vectors like : vec1 <- rnorm(1) vec2 <- rnorm(2) vec3 <- rnorm(3) and so on........... Here I tried following : for (i in 1:10) paste("vec", i, sep="") <- rnorm(i) However obviously that is not working. Here vectors I need to be seperated i.e I do not want to create a "list". How to modify above code? -- View this
2012 Nov 08
5
map two names into one
Thanks. Yes. Your approach can identify: Glaxy ace S 5830 and S 5830 Glaxy ace But you can not identify using same program: Iphone 4S 16 G Iphone 4S 16G How should I solve both in same time. Kind regards,Tammy [[alternative HTML version deleted]]
1999 Dec 16
2
R question
I have the following question, which is elementary but I am unable to answer. In a for(i=10) loop, I am trying to represent the 10 1-dimensional vectors l1, l2,... l10 by some expression that will run through these values. ie. soppose I want to add l1 + ... + l10 I could go x <- 0 for(i in 1:10){ x <- x+ l(i)} This should return x to be the sum of the 10 li's for i from 1 to 10
2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2009 Jul 27
1
how to use do.call together with cbind and get inside a function
Dear R-helpers: I have a question related to using do.call to call cbind and get. #the following works vec1 <- c(1,2) vec2 <- c(3,4) ColNameVec <- c('vec1','vec2') mat <- do.call("cbind",lapply(ColNameVec,get)) mat #put code above into a function then it does not work #before doing so, first remove vec1 and vec2 from global environment rm(vec1,vec2) test
2008 Dec 30
2
[LLVMdev] Folding vector instructions
Hello. Sorry I am not sure this question should go to llvm or mesa3d-dev mailing list, so I post it to both. I am writing a llvm backend for a modern graphics processor which has a ISA very similar to that of Direct 3D. I am reading the code in Gallium-3D driver in a mesa3d branch, which converts the shader programs (TGSI tokens) to LLVM IR. For the shader instruction also found in LLVM IR,
2008 May 12
1
lexicographic comparison of two vectors
Is there any built-in way to lexicographically compare two vectors of the same length in R? The textbook algorithm could be coded as follows: lex.cmp <- function (vec1,vec2) { for (j in 1:length(vec1)) { if (vec1[j] < vec2[j]) { return(-1) } if (vec1[j] > vec2[j]) { return(1) } } return(0) } Thanks, Gabriel
2010 Jul 12
2
findInterval and data resolution
Hello Wise Ones... I need a clever way around a problem with findInterval. Consider: vec1 <- 1:10 vec2 <- seq(1, 10, by = 0.1) x1 <- c(2:3) a1 <- findInterval(x1, vec1); a1 # example 1 a2 <- findInterval(x1, vec2); a2 # example 2 In the problem I'm working on, vec* may be either integer or numeric, like vec1 and vec2. I need to remove one or more sections of this vector;
2011 Jun 03
2
Arules: R Crashes when running eclat with tidLists=TRUE
Hello, I'm using the eclat function of the arules package (1.0-6) for the identification of frequent itemsets. I need the tidLists, but if I set in the function tidLists=TRUE R crashes (Windows XP Professional SP3, 32 bit, R version 2.12.1 (2010-12-16), reproducible on two different computers) with two different error messages or non at all. Minimum examples are: library(arules)
2001 Nov 01
1
Erratic behaviour of sammon()
I'm not sure this list is the right place for this thing. I noticed some erratic behaviour in sammon(). Running sammon on two nearly identical sets of data results in very different results. Below is an example. I create an initial configuration with cmdscale() and store it into 'vec1'. I write this to file, and read it back in again to 'vec2'. According to cor() on the three
2013 Mar 22
2
A question on function return
Hello again, Let say I have following user defined function: fn <- function(x, y) { Vec1 <- letters[1:6] Vec2 <- 1:5 return(list(ifelse(x > 0, Vec1, NA), ifelse(y > 0, Vec2, NA))) } Now I have following calculation: > fn(-3, -3) [[1]] [1] NA [[2]] [1] NA > fn(3, -3) [[1]] [1] "a" [[2]] [1] NA Here I can not understand why in the second case, I get