search for: v2

Displaying 20 results from an estimated 14010 matches for "v2".

2008 Jan 13
4
For Loop performance
Hello, Newbie question and hope you can help . I have two vector V1 and V2, where length(V2) = length of (V1) * 2; length(V1) ~ 16,000. For each member in V1, I need to compare 2 element of V2 for equality i.e. for (I in 1:length (V1)) { if ( v2[i] == v1[i] & v2[i+1]==v1[i] ){ statement_1 statement_2 . } } This...
2012 Dec 01
5
How to built a pivot table of value
Hi R users Imagine the table "base": p=c("d","d","b","b","a","a") q=c("v1","v2","v1","v2","v1","v2") r=c(5,2,4,8,9,7) base=data.frame(p,q,r) base p q r 1 d v1 5 2 d v2 2 3 b v1 4 4 b v2 8 5 a v1 9 6 a v2 7 How programming R to get this result: v1 v2 a 9 7 b...
2020 Jun 27
0
[centos/centos.org] branch master updated: Updated page for AWS AMI images ID and link
...ages.csv +++ b/_data/aws-images.csv @@ -1,50 +1,81 @@ "Version","Region","Architecture","AMI ID","Deploy link" -"CentOS 8","us-east-1","x86_64","ami-01ca03df4a6012157","https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-01ca03df4a6012157" -"CentOS 8","us-east-1","x86_64","ami-01ca03df4a6012157","https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-01ca03df4a6012157" -"C...
2010 Apr 03
4
question difference of roaming profile between WinXP and Win7
Hello I want to add Win7 machine to my Samba PDC with WinXP clients. Google tells me I have to add a .V2 to my profiles. The samba log ask about a .v2 share. Can someone explain me the difference of the v2 extension at the profile names and the roaming profile share? Following my settings: smb.conf: [global] logon path = \\%L\nt-profile logon home = \\%L\nt-profile [nt-profile]...
2020 Nov 12
0
[centos/centos.org] branch master updated: Reflected new 7.9.2009 release and updated AMI IDs for AWS
...t a/_data/aws-images.csv b/_data/aws-images.csv index 4d6c7a9..c583962 100644 --- a/_data/aws-images.csv +++ b/_data/aws-images.csv @@ -39,43 +39,43 @@ " CentOS Linux 8 ","eu-north-1","aarch64","ami-02e921ca8f16f9ee4","https://console.aws.amazon.com/ec2/v2/home?region=eu-north-1#LaunchInstanceWizard:ami=ami-02e921ca8f16f9ee4" " CentOS Linux 8 ","me-south-1","aarch64","ami-0699d4d858abc9036","https://console.aws.amazon.com/ec2/v2/home?region=me-south-1#LaunchInstanceWizard:ami=ami-0699d4d858abc9036&qu...
2006 Apr 21
3
Creat new column based on condition
Hi, How can I accomplish this task in R? V1 10 20 30 10 10 20 Create a new column V2 such that: If V1 = 10 then V2 = 4 If V1 = 20 then V2 = 6 V1 = 30 then V2 = 10 So the O/P looks like this V1 V2 10 4 20 6 30 10 10 4 10 4 20 6 Thanks in advance. Sachin __________________________________________________ [[...
2012 Mar 28
1
Changing multiple instances in data.frame
...d but I cannot find a more elegant solution. I would like to be able to scan through a data.frame and remove multiple and various instances of certain contents. A trivial example is below. It works, it just seems like there should be a one line solution. #Example data: a <- data.frame(V1=1:3,V2=c(paste(LETTERS[1],LETTERS[1:3],sep='')),options(stringsAsFactors = FALSE)) #> a # V1 V2 #1 1 AA #2 2 AB #3 3 AC #Cumbersome solution (which would be even more cumbersome with real data) indices.of.aa <- which(a$V2 %in% "AA") indices.of.ab <- which(a$V2 %in% "A...
2008 Oct 01
3
"tapply versus by" in function with more than 1 arguments
...er of rows nr = 10 #the third column is to enforce that I need correlation on two variables only dataf = as.data.frame(matrix(c(rnorm(nr),rnorm(nr)*2,runif(nr),sort(c(1,1,2,2,3,3,sample(1:3,nr-6,replace=TRUE)))),ncol=4)) names(dataf)[4] = "class" #> dataf #            V1             V2                V3                 class #1   0.56933020      1.2529931     0.30774422     1 #2   0.41702299     -1.6441547     0.76140046     1 #3  -1.07671647     -4.8747575     0.43706944     1 #4  -1.97701167      1.3015196     0.04390175     2 #5   0.56501325      1.8597720     0.08174124     2...
2009 Nov 08
5
look up and Missing
HI R-Users Assume that I have a data frame 'temp' with several variables (v1,v2,v3,v4,v5.). v1 v2 v3 v4 v5 1 2 3 3 6 5 2 4 2 0 2 -9 5 4 3 6 2 1 3 4 1, I want to look at the entire row values of when v2 =-9 like 2 -9 5 4 3 I wrote K<- list(if(temp$v2)==-9)) I wrote the like this but it gave me which is no...
2006 Jul 30
2
NIST StRD linear regression
...precision. I am using R 2.3.1 for Windows XP. rm(list=ls()) require(gsubfn) defaultPath <- "my path" data.base <- "http://www.itl.nist.gov/div898/strd/lls/data/LINKS/DATA" reg.data <- paste(data.base, "/Filip.dat", sep="") model <- "V1~V2+I(V2^2)+I(V2^3)+I(V2^4)+I(V2^5)+I(V2^6)+I(V2^7)+I(V2^8)+I(V2^9)+I (V2^10)" filePath <- paste(defaultPath, "//NISTtest.dat", sep="") download.file(reg.data, filePath, quiet=TRUE) A <- read.table(filePath, skip=60, strip.white=TRUE) lm.data <- lm(formula(model), A)...
2011 Aug 06
4
row*matrix
Hi all, I'm learning R. I'm used to Matlab and am having the following issue: I define a column vector and matrix and then multiply them. The result is not what I expect: v2 <- c(0,1,0) M <- cbind(c(1,4,7),c(2,5,8),c(3,6,9)) M*v2 [,1] [,2] [,3] [1,] 0 0 0 [2,] 4 5 6 [3,] 0 0 0 I expect the result to be a column, specifically the 2nd column of M. Now I want to left multiply the matrix by a row vector, and I get errors: t(v2)*M Er...
2010 Feb 08
1
Follow-up Question: data frames; matching/merging
Wow.. thanks for the deluge of responses! Aggregate seems like the way to go here. But, suppose that instead of integers in column V2, I actually have dates (and instead of keeping the minimum integer, I want to keep the earliest date): > df = data.frame(V1=c(1,1,2,3,1,2),V2=c('2002-03-13','1989-03-10','1988-01-20','1997-05-15','1996-11-18','2000-01-12')); > aggregate(df$V2,d...
2006 Nov 01
4
extract values from a vector
Hello, I'm looking for a solution for the following problem: I have two vectors V1 <- c("apple","honey","milk","bread","butter") V2 <- c("bread","milk") now, I would like to know for each element in V1 if it's equal to one of the elements in V2 I could do: which(V1 == V2[1] | V1 == V2[2]) but what if I don't know the length of V2 and it's content??? Thank you in advance! Antje
2012 Oct 07
2
Reshape2, melt, order of categorical variable and ggplot2
Hello everyone, I have the following data frame: > df V1 V2 V3 1 bench1_10 16675 16678 2 bench1_10 16585 16672 3 bench1_100 183924 185563 4 bench1_100 169310 184806 5 bench1_300 514430 516834 6 bench1_300 510743 514062 7 bench1_500 880146 877882 8 bench1_500 880146 857359 9 bench1_1k 880146 1589600 10 bench1_1k 880146 1709990 &...
2004 Sep 08
4
factor always have type integer
...nteger", independently of the type of the levels. This has a strange side effect. When a variable is "imported" into a data frame, its type changes. character variables automatically are converted to factors when imported into data frames. Here is an example: > v1<-1:3 > v2<-c("a","b","c") > df<-data.frame(v1,v2) > typeof(v2) [1] "character" > typeof(df$v2) [1] "integer" It is somewhat surprising that the types of v2 and df$v2 are different. the answer is to do levels(df$v2)[df$v2] but that is somew...
2012 Sep 26
5
create new column in a DF according to values from another column
Hi everyone, I have a small problem in my R-code. Imagine this DF for example: DF <- data.frame(number=c(1,4,7,3,11,16,14,17,20,19),data=c(1:10)) I would like to add a new column "Station" in this DF. This new column must be automatically filled with: "V1" or "V2" or "V3". The choice must be done on the numbers (1st column). For example, I would like to have "V1" in the column "Station" in the rows where the numbers of the 1st column are: 1,7,11,16 ; then I would like to have "V2" in the rows where the numbers a...
2005 Dec 06
3
merging with aggregating
Dear List, I have two data.frame of the following form: A: n V1 V2 1 12 0 2 10 8 3 3 8 4 8 4 6 7 3 7 12 0 8 1 0 9 18 0 10 1 0 13 2 0 B: n V1 V2 1 0 2 2 0 3 3 1 9 4 12 8 5 2 9 6 2 9 8 2 0 10 4 1 11 7 1 12 0 1 Now I want to merge those frame to one data.frame with summing up the columns V1 and V2 but not...
2009 Apr 23
2
conditional grouping of variables: ave or tapply or by or???
Dear R Users, I have the following data frame: v1 <- c(rep(10,3),rep(11,2)) v2 <- sample(5:10, 5, replace = T) v3 <- c(0,1,2,0,2) df <- data.frame(v1,v2,v3) > df v1 v2 v3 1 10 9 0 2 10 5 1 3 10 6 2 4 11 7 0 5 11 5 2 I want to add a new column v4 such that its values are equal to the value of v2 conditional on v3=0 for each subgroup of v1. In the above...
2008 Sep 05
1
binary order combinations
Dear all! I have a vector of names names<-("V1", "V2", "V3",....., "V15") I could create all possible combinations of these names (of all lengths) using R: combos<-lapply(1:15,function(x) {combn(names,x) }) I get a list with all possible combinations of elements of 'names' that looks like this (just the very beg...
2015 Feb 18
2
[LLVMdev] local variable in Pattern definition?
Hi guys, When I am trying to define pattern in a multi class, I got something like this: “ multi class P_PAT<string sty, SDNode tNode> { def : Pat<( !cast<ValueType>(“v2” # sty) (tNode !cast<ValueType>(“v2” # sty):$src1, !cast<ValueType>(“v2” # sty):$src2) ), ( add !cast<ValueType>(“v2” # sty):$src1, !cast<ValueType>(“v2” # sty):$src2) >; } “ noticed that in the above pattern, the "!cast<ValueType>(“v2” # s...