Displaying 20 results from an estimated 207 matches for "out2".
Did you mean:
out
2012 Jul 10
1
cbind and cbind.data.frame
...ame cbind.ts*
Non-visible functions are asterisked
>
>
> ## now i explicitly tell cbind to use the data.frame method
> ## (which is what i assumed it was doing automatically in the last
example)
> ## but this produces something very different from before, a data.frame
> out2 <- cbind.data.frame(c1,c2)
> out2
c1 c2
1 A 1
2 A 2
3 B 3
4 B 4
> class(out2)
[1] "data.frame"
> mode(out2)
[1] "list"
>
>
> ## can someone explain why these outputs are different. Thanks, James.
>
c1 <- c("A",&...
2010 Nov 03
1
smooth: differences between R and S-PLUS
...LE
# Comments indicates which step of the 4(3RSR)2H algorithm I try to
replicate.
# Data
x1 <- c(4, 1, 3, 6, 6, 4, 1, 6, 2, 4, 2)
# 4
out = NULL
for (i in 1:11) {out[i] = median(x1[i:(i+3)])}
out[is.na(out)] = x1[is.na(out)]
out
# (3RSR)
x2 = smooth(out, "3RSR", twiceit = F)
x2
# 2
out2 = NULL
for (i in 1: 11) {out2[i] = median(x2[i:(i+1)])}
out2[is.na(out2)] = x2[is.na(out2)]
out2
# H
filter(out2, filter = c(1/4, 1/2, 1/4), sides = 2)
[[alternative HTML version deleted]]
2013 Sep 05
2
binary symmetric matrix combination
...c1 1 0 0 1 1 0 0 0 0 0
c2 1 0 1 0 1 0 0 0 0 0
l17 1 0 1 1 0 0 0 0 0 0
h4 1 0 0 0 0 0 1 1 0 0
s2 1 0 0 0 0 1 0 1 0 0
s30 1 0 0 0 0 1 1 0 0 0
e5 1 0 0 0 0 0 0 0 0 1
l15 1 0 0 0 0 0 0 0 1 0",sep="",header=TRUE))
names1<-unique(c(colnames(m1),colnames(m2),colnames(m3),colnames(m4)))
Out2<-matrix(0,length(names1),length(names1),dimnames=list(names1,names1))
vec1<- paste0(colnames(m1)[col(m1)],rownames(m1)[row(m1)])
vecOut<- paste0(colnames(Out2)[col(Out2)],rownames(Out2)[row(Out2)])
Out2[match(vec1,vecOut)]<- m1
vec2<- paste0(colnames(m2)[col(m2)],rownames(m2)[row(m2)...
2012 Jun 28
3
Storing results in a single file after looping over all files
...y<-data$PHI
num<-length(y)
index1<-c(1:num_sample)[y==1]
index2<-c(1:num_sample)[y==0]
gen<-as.matrix(data[,-c(1:2)])
source("pcc.R") # a function for my use
out<- fpc_func(gen,num,index1,index2)
out1<-as.data.frame(out)
id1<-data[,2]
id<- as.data.frame(iid1)
out2<-cbind(iid1,out1)
colnames(out2)[2] <- of
}
write.table(out2, file="ALL.txt", append=T, col.names=T, row.names=F, quote=F, sep = "\t")
#######################
I can do it for each file separately but can't figure out how to store the results in one file.
If I do it...
2009 Nov 25
1
reshape question
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091124/38de5e23/attachment-0001.pl>
2011 Mar 18
1
help please: put output into dataframe
...umber of variables
var1 <- rnorm(500, 10,4)
var2 <- rnorm(500, 20, 8)
var3 <- rnorm(500, 30, 18)
var4 <- rnorm(500, 40, 20)
datafr1 <- data.frame(var1, var2, var3, var4)
# my unsuccessful codes
nvar <- ncol(datafr1)
for (i in 1:nvar) {
out1 <- NULL
out2 <- NULL
medianx <- median(getdata[,i], na.rm = TRUE)
show(madx <- mad(getdata[,i], na.rm = TRUE))
MD1 <- c(medianx + 2*madx)
MD2 <- c(medianx - 2*madx)
out1[i] <- which(getdata[,i] > MD1) # store data that ar...
2011 Aug 26
1
Reg: Workaround to use pivot_root while using "rootfs" for "/" ?
...The return code from the system call ?pivot_root? is EINVAL (Invalid
arguments).
I isolated the issue to this specific condition check within the system
call.
This is an code snippet from fs/namespace.c::pivot_root
* error = -EINVAL;
if (root.mnt->mnt_root != root.dentry)
goto out2; /* not a mountpoint */
if (root.mnt->mnt_parent == root.mnt) << this represents a circular
mount reference
goto out2; /* not attached */
if (new.mnt->mnt_root != new.dentry)
goto out2; /* not a mountpoint */
if (new.mnt->mnt_parent == new.mnt)...
2015 Dec 01
3
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...use.h"
>> > #include "vmmouse.h"
>> > @@ -84,21 +85,12 @@ struct vmmouse_data {
>> > * implementing the vmmouse protocol. Should never execute on
>> > * bare metal hardware.
>> > */
>> > -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
>> > -({ \
>> > - unsigned long __dummy1, __dummy2; \
>> > - __asm__ __volatile__ ("inl %%dx" : \
>> > - "=a"(out1),...
2015 Dec 01
3
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...use.h"
>> > #include "vmmouse.h"
>> > @@ -84,21 +85,12 @@ struct vmmouse_data {
>> > * implementing the vmmouse protocol. Should never execute on
>> > * bare metal hardware.
>> > */
>> > -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
>> > -({ \
>> > - unsigned long __dummy1, __dummy2; \
>> > - __asm__ __volatile__ ("inl %%dx" : \
>> > - "=a"(out1),...
2015 Dec 01
2
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...<asm/vmware.h>
>
> #include "psmouse.h"
> #include "vmmouse.h"
> @@ -84,21 +85,12 @@ struct vmmouse_data {
> * implementing the vmmouse protocol. Should never execute on
> * bare metal hardware.
> */
> -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
> -({ \
> - unsigned long __dummy1, __dummy2; \
> - __asm__ __volatile__ ("inl %%dx" : \
> - "=a"(out1), \
> - "=b"(out2), \
> - "=c"(out3), \
> - "=d"(out4), \
> - "=S"(__dum...
2015 Dec 01
2
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...<asm/vmware.h>
>
> #include "psmouse.h"
> #include "vmmouse.h"
> @@ -84,21 +85,12 @@ struct vmmouse_data {
> * implementing the vmmouse protocol. Should never execute on
> * bare metal hardware.
> */
> -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
> -({ \
> - unsigned long __dummy1, __dummy2; \
> - __asm__ __volatile__ ("inl %%dx" : \
> - "=a"(out1), \
> - "=b"(out2), \
> - "=c"(out3), \
> - "=d"(out4), \
> - "=S"(__dum...
2011 Apr 03
1
zoo:rollapply by multiple grouping factors
...#39;right') })
out1
out1[,,1]
# Which "works" in that it gives me the right answers, but in a format
from which I can't figure out how to get back into the format I want.
# Method 2.
fun<-function(x){y<-zoo(x);coredata(rollapply(y, w,
cv,na.pad=T,align='right'))}
out2<-aggregate(daty,by=datx,fun)
out2
# Which superficially "works" better, but again only in a format I can't
figure out how to use because the output seems to be a mix of data.frame
and lists.
out2[1,4]
out2[1,5]
is.data.frame(out2)
is.list(out2)
# The situation is made more prob...
2015 Dec 02
3
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...Dec 01, 2015 at 02:45:27PM -0800, Dmitry Torokhov wrote:
> > On Tue, Dec 1, 2015 at 2:32 PM, Sinclair Yeh <syeh at vmware.com> wrote:
> > > Hi,
> > >
>
> <snip>
>
> > >> > */
> > >> > -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
> > >> > -({ \
> > >> > - unsigned long __dummy1, __dummy2; \
> > >> > - __asm__ __volatile__ ("inl %%dx" : \
> > >> > -...
2015 Dec 02
3
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...Dec 01, 2015 at 02:45:27PM -0800, Dmitry Torokhov wrote:
> > On Tue, Dec 1, 2015 at 2:32 PM, Sinclair Yeh <syeh at vmware.com> wrote:
> > > Hi,
> > >
>
> <snip>
>
> > >> > */
> > >> > -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
> > >> > -({ \
> > >> > - unsigned long __dummy1, __dummy2; \
> > >> > - __asm__ __volatile__ ("inl %%dx" : \
> > >> > -...
2013 Jun 08
1
splitting a string column into multiple columns faster
...ata frame that I have to split: I have to distill
the numbers from the text. Below is my example and my solution.
x<-data.frame(x=c("aaa1_bbb1_ccc3","aaa2_bbb3_ccc2","aaa3_bbb2_ccc1"))
x
library(stringr)
out<-as.data.frame(str_split_fixed(x$x,"aaa",2))
out2<-as.data.frame(str_split_fixed(out$V2,"_bbb",2))
out3<-as.data.frame(str_split_fixed(out2$V2,"_ccc",2))
result<-cbind(x,out2[1],out3)
result
My problem is:
str_split.fixed is relatively slow. In my real data frame I have over
80,000 rows so that it takes almost 30 secon...
2012 Apr 09
3
For loops
Hi,
I am having trouble with syntax for a for loop. Here is what I am trying to
do.
class=c(rep(1,3),rep(2,3),rep(3,3))
out1=rnorm(length(class))
out2=rnorm(length(class))
out3=rnorm(length(class))
data=data.frame(class,out1,out2,out3)
dat.split=split(data,data$class)
for(i in 1:3){
sub[i]=dat.split[i]
}
However, the for loop doesn't work. I want to assign each split to a
different data object. Better yet, how I could assign each clas...
2005 Nov 22
1
windrose (circular package) error in table (PR#8341)
Full_Name: Allyson Williams
Version: 2.1.1
OS: Windows XP
Submission from: (NULL) (203.25.1.208)
I'm using the 'Circular' package to plot windroses. I think the output table
(see out2$table below) is incorrect when using different rotations. More
precisely, when a rotation is used for the plot, the output table stuffs up.
This example is from the code in the help notes, although the input data (dir,
mag) are changed):
> dir <- c(1:50,1:50)
> mag <- c(1:100)
>...
2008 Jul 06
3
Lots of huge matrices, for-loops, speed
...making use of the header information coming with
# the .asc-input files, ESRI-format)
hd <- read.table (filelist [1], nrows = 6)
cols <- hd[1,2]
rows <- hd[2,2]
times <- length (filelist)
items <- 4 + ncol (x)
# Prepare output
out1 <- matrix (numeric (times * cols), ncol = cols)
out2 <- matrix (numeric (items * cols), ncol = items)
out3 <- as.numeric (items)
# Prepare .asc-files
filenames <- c("R2", "adj.R2", "p", "b0", colnames (x))
for (i in 1:items) {
write.table (hd, file = paste (outfolder, filenames [i],".asc",se...
2009 Jan 20
1
Setting up an outgoing trunk group
Hi All,
I'm confused! My Asterisk system has a Zap trunk and three SIP trunks.
I'd like to configure the dialplan to route via the first trunk in a
list and if that's not available or it's busy, fall over to the
second, then to the third, etc.
AIUI Dial(Zap/1&SIP/out1&SIP/out2/${EXTEN}) rings all the trunks in
the list and bridges to the first to answer. Unfortunately, that's not
what I want, which is (in pseudocode):
if Zap/1 is available then
Dial(Zap/1/${EXTEN})
elseif SIP/out1 is available then
Dial(SIP/out1/${EXTEN})
else
Dial(SIP/out2/${EXTEN})...
2015 Dec 02
4
[PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros
...Tue, Dec 1, 2015 at 2:32 PM, Sinclair Yeh <syeh at vmware.com> wrote:
> > > > > Hi,
> > > > >
> > >
> > > <snip>
> > >
> > > > >> > */
> > > > >> > -#define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
> > > > >> > -({ \
> > > > >> > - unsigned long __dummy1, __dummy2; \
> > > > >> > - __asm__ __volatile__ ("inl %%dx" : \
>...