search for: val3

Displaying 20 results from an estimated 66 matches for "val3".

Did you mean: val
2011 Mar 10
1
How to use conditional statement
Dear R helpers Suppose val1 = c(10, 20, 35, 80, 12) val2 = c(3, 8, 11, 7) I want to select either val1 or val2 depending on value of third quantity val3. val3 assumes either of the values "Monthly" or "Yearly". If val3 = "Monthly", then val = val1 and if val3 = "Yearly", then val = val2. I tried the ifelse statement as ifelse(val3 = "Monthly", val = val1, val2)   I get following error > ife...
2009 Feb 17
4
joining "one-to-many"
...1 <- round(rnorm(10),2) val2 <- c("a", "b", "c", "a", "b", "d", "f", "e", "b", "e") t1 <- data.frame(loc, val1, val2) t2 <- data.frame(loc=c("L1","L2","L3"), val3 = c("m", "n", "p"), val4 = c(25, 67, 48)) # join one-to-many n <- nrow(t1) m <- nrow(t2) t1$val3 <- rep(1, n) t1$val4 <- rep(1, n) for (i in 1:n) { for (j in 1:m){ if (t1$loc[i]==t2$loc[j]) { t1$val3[i] <- as.character(t2$val3[j])...
2009 Mar 03
2
preparing data for barplot()
What is the best way to produce a barplot from my data? I would like the barplot to show each person with the values stacked val1+val2+val3, so there is one bar for each person When I use barplot(data.matrix(realdata)), it shows one bar for each value instead. To post here, I created an artificical data set, but it works fine. fakedata <- as.data.frame(list(LETTERS[1:3])) colnames(fakedata) <- 'people' fakedata['va...
2005 Oct 11
1
a problem in random forest
Hi, there: I spent some time on this but I think I really cannot figure it out, maybe I missed something here: my data looks like this: > dim(trn3) [1] 7361 209 > dim(val3) [1] 7427 209 > mg.rf2<-randomForest(x=trn3[,1:208], y=trn3[,209], data=trn3, xtest=val3[, 1:208], ytest=val3[,209], importance=T) my test data has 7427 observations but after prediction, > dim(mg.rf2$votes) [1] 7361 2 which has the same length as my training data. but if I use mg.rf&l...
2012 Apr 26
6
print table on plot
Hello, I would like to be able to plot an array on a plot, something like: |arg1 | arg2 | arg3 val1| 0.9 | 1.1 | 2.4 val2| 0.33 | 0.23 | -1.4 val3| hello| stop | test I know Rwave is good to report but don't want to use it. ? Is there a package that allow quick and dirty plot of dataframes like this ? Thanks a lot -- View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4589804.html Sent from the R h...
2012 Oct 18
1
mean value calculation
Dear all, I want to calculate mean values for multiple rows: structure(list(Name = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), .Label = c("AKT", "CKT"), class = "factor"), val1 = c(2, 3, 2, 2, 2, 5, 3, 8, 2), val2. = c(4, 5, 4, 8, 4, 8, 4, 7, 4), val3 = c(5, 6, 5, 9, 5, 9, 5, 9, 5)), .Names = c("Name", "val1", "val2.", "val3"), class = "data.frame", row.names = c(NA, 9L)) For example: as an output I must get Name val1 val2 val3 AKT CKT I wrote this : #as.matrix(tapply(dat[,2:4], dat[,1]...
2018 Mar 21
2
how to add a child to a child in XML
I am trying to add a child to a child using XML package in R. the following fails library(XML) node1 <- c("val1","val2","val3") names(node1) <- c("att1","att2","att3") root <- xmlNode("root", attrs=node1) node2 <- LETTERS[1:3] names(node2) <- paste("name",1:3,sep="") root <- addChildren(root,xmlNode("child1",attrs=node2)) node3...
2018 Mar 21
0
how to add a child to a child in XML
...quot;A" name2="B" name3="C"/> On the other hand, you might consider using newXMLNode() instead of xmlNode() as it accepts a "parent = " argument. The alternative using newXMLNode() would look like... atts_root <- c("val1","val2","val3") names(atts_root) <- c("att1","att2","att3") root <- newXMLNode("root", attrs = atts_root) atts_child <- LETTERS[1:3] names(atts_child) <- paste("name",1:3,sep="") child <- newXMLNode("child",attrs = atts_ch...
2018 Mar 22
2
how to add a child to a child in XML
...quot;A" name2="B" name3="C"/> On the other hand, you might consider using newXMLNode() instead of xmlNode() as it accepts a "parent = " argument. The alternative using newXMLNode() would look like... atts_root <- c("val1","val2","val3") names(atts_root) <- c("att1","att2","att3") root <- newXMLNode("root", attrs = atts_root) atts_child <- LETTERS[1:3] names(atts_child) <- paste("name",1:3,sep="") child <- newXMLNode("child",attrs = atts_ch...
2018 Mar 22
0
how to add a child to a child in XML
...uot; name3="C"/> > > > On the other hand, you might consider using newXMLNode() instead of xmlNode() as it accepts a "parent = " argument. The alternative using newXMLNode() would look like... > > atts_root <- c("val1","val2","val3") > names(atts_root) <- c("att1","att2","att3") > root <- newXMLNode("root", attrs = atts_root) > > atts_child <- LETTERS[1:3] > names(atts_child) <- paste("name",1:3,sep="") > child <- newXMLNode(&q...
2018 Mar 22
1
how to add a child to a child in XML
...quot;A" name2="B" name3="C"/> On the other hand, you might consider using newXMLNode() instead of xmlNode() as it accepts a "parent = " argument. The alternative using newXMLNode() would look like... atts_root <- c("val1","val2","val3") names(atts_root) <- c("att1","att2","att3") root <- newXMLNode("root", attrs = atts_root) atts_child <- LETTERS[1:3] names(atts_child) <- paste("name",1:3,sep="") child <- newXMLNode("child",attrs = atts_ch...
2018 Apr 18
1
[RFC] Making GVN able to visit the same block more than once
...n exactly as we want. However we then get problems elsewhere. The problem ============ Let's take a look at this function: define i32 @multiple_path_test(i32* %ptr1, i32* %ptr2, i32* %ptr3) { entry: %val1 = load i32, i32* %ptr1, align 4 %val2 = load i32, i32* %ptr2, align 4 %val3 = load i32, i32* %ptr3, align 4 %cmp1 = icmp slt i32 %val1, %val2 br i1 %cmp1, label %a, label %b a: %cmp2 = icmp slt i32 %val1, %val3 br i1 %cmp2, label %end, label %b b: %bphi = phi i32* [ %ptr2, %a ], [ %ptr3, %entry ] br label %end end: %retptr = phi i32* [...
2008 Apr 22
3
[PATCH 0/3] ia64/pv_ops preparation
Hi. This patchset is preparation patches for ia64/pv_ops support. They are almost trivial and mainly make kernel paravirtualization friendly. thanks, Diffstat: arch/ia64/kernel/irq_ia64.c | 1 - include/asm-ia64/intrinsics.h | 11 +++++++++++ include/asm-ia64/mmu_context.h | 6 +----- include/asm-ia64/smp.h | 2 ++ include/asm-ia64/system.h | 10 ++++++++-- 5 files
2008 Jun 09
1
Basic Question on Keys/Values
As a java programmer, I'm having issue conceptualizing the following use case: Given an value, passed into a function, how do I pull out the lookup? Ie. A list of keys (key1, key2, key3) A list of values (val1,val2,val3) I want to write a function (or is there something built in?) such that Callit <- (thekey) { (magic happens here) Return value } Any ideas? Thanks a bunch! ============================================================================== Please access the attached hyperlink for an important el...
2009 Jun 08
1
Looking for easy way to normalize data by groups
...data.frame(PID = c(rep("A", 12), rep("B", 12), rep("C", 12)), Time = rep(c(0, 0, 0, 0, 30, 30, 30, 30, 60, 60, 60, 60), 3), Dset = rep(c(1, 2),18), Val1 = rnorm(36), Val2 = rnorm(36), Val3 = rnorm(36), Val4 = rnorm(36)) You can plot the data nicely with x=Time and y=Val1 by grouping PID and facetting for Dset. p <- ggplot(df) + geom_line(aes(x=Time,y=Val1,group=PID)) + geom_point(aes(x=Time,y=Val1,colour=PID)) + facet_grid(. ~ Ecc) t...
2012 Dec 09
3
[LLVMdev] ARM assembly
Hi All, I am working to cross compile (just generate assembly code) a simple C code in ARM. First, I use CLANG to get LLVM bytecode, then I use llc to generate assembly for ARM. The problem is it never uses any other register except r0-r3 and always uses spill code even if other register are available to use. Anyone has any idea? Thanks Best Regards, A. Yazdanbakhsh
2007 Jun 30
1
Importing an Excel file that has merged cells
...ving it as a CSV or using RODBC). But the original file is using merged cell in its first column, which gives the name of the observation. (I am dealing with repeated measurements for the same observation) So when I open the dataframe in R it looks like this Col1 Col2 Col3 name1 val1 val2 val3 val4 .... name2 val5 val6 val7 val8 Everything is fine, except that the name of the observation is on the first line and the following rows are empty. Until a new observation starts, where a new name appears in the respective row and the following rows are empty and so on. The number of...
2007 Dec 06
3
Setting Multiple Values via func_odbc ...?
...MySQL, but that's a pain in the ass because the asterisk-addons package has no default rpm spec file for building an RPM. I had something like this in func_odbc.conf: [VOX_LOG_CALL_LEG] dsn=MySQL write=INSERT into CallLog (Source,IDDCode,AreaCode,ProviderId,SIPReply) values (${VAL1},${VAL2},${VAL3},${VAL4},${VAL5}) but it doesn't like it. In order for this to work, I'd have to have several LOG_CALL_LEG functions, each taking one parameter, and then requiring several database updates! Doug. _________________________________________________________________________________...
2013 Jan 29
4
[LLVMdev] [RFC] Attributes Rewrite (Final)
...This is the final proposal for the language changes. There isn't a lot of new information except for the syntax changes for the new feature. Executive Summary: The new syntax is: #0 = attributes { noinline align=4 "cpu"="cortex-a8" } #1 = attributes { attr = (val1 val2 val3) } #bork = attributes { sspreq noredzone } define void @foo() #0 #bork { ret void } The 'align' and "cpu" attributes both have a value associated with them. The 'attr' attribute in '#1' has multiple values associated with it. (The BNF is below in the 'IR Ch...
2013 Feb 03
0
[LLVMdev] [RFC] Attributes Rewrite (Final)
On Jan 29, 2013, at 2:42 PM, Bill Wendling <isanbard at gmail.com> wrote: > Executive Summary: > > The new syntax is: > > #0 = attributes { noinline align=4 "cpu"="cortex-a8" } > #1 = attributes { attr = (val1 val2 val3) } > #bork = attributes { sspreq noredzone } > > define void @foo() #0 #bork { ret void } The general syntax LGTM. It seems clean and fits well with what we have. > The 'align' and "cpu" attributes both have a value associated with them. The 'attr' attrib...