Displaying 20 results from an estimated 35 matches for "num2".
Did you mean:
num
2010 Apr 20
2
having more than one plot in one figure
Hi All,
I have been trying to plot multiple line plots with different colors on one
figure. in my example below I was able to plot cat vs num1 as a dot plot
connected with lines but was not able to do that for cat vs num2 and I do
not know how to add the third plot cat vs num3. below is my code
df <- data.frame(cat=1:10, num1=rnorm(10), num2=rnorm(10), num3=rnorm(10))
plot(df$num1, type="b", col="red", xlab="categories", ylab="random numbers")
points(df$num1, type="p...
2013 Apr 09
1
(no subject)
Hi
I would like to normalize my data by one of the variables in long format.
My data is like this:
>
t1<-data.frame(id=rep(1:3,rep(3,3)),dt=rep(1:3,rep(9,3)),var=c('num1','num2','norm'),value=rnorm(27))
> t1
id dt var value
1 1 1 num1 -1.83276256
2 1 1 num2 1.57034303
3 1 1 norm 0.60008563
4 2 1 num1 -0.96893477
5 2 1 num2 0.30423346
6 2 1 norm -0.07044640
7 3 1 num1 -1.30558219
...
in this case there are 3 ids and 3 dates...
2006 Feb 09
1
List Conversion
Hello,
I have a list (mode and class are list) in R that is many elements long and of the form:
>length(list)
[1] 5778
>list[1:4]
$ID1
[1] "num1"
$ID2
[1] "num2" "num3"
$ID3
[1] "num4"
$ID4
[1] NA
I'd like to convert the $ID2 value to be in one element rather than in two.?? It shows up as c(\"num2\", \"num3\") if I try to use paste(list[2], collapse=""). I need to do this over the length of the e...
2005 Sep 05
2
USING TWO ACCOUNTS WITH BROADVOICE
...his is not working.
When I call into my box I hear busy tone.
My config looks like this:
[root@voip asterisk]# cat sip.conf
[general]
externip=mydomain
bindaddr = 0.0.0.0
port=5060
localnet=192.168.1.0/255.255.255.0
disallow=all
allow=ulaw
register => num1:pass@sip.broadvoice.com
register => num2:passsip.broadvoice.com
tos=0x18
srvlookup=yes
nat=never
insecure=yes
[sip.broadvoice.com]
type=peer
username=NUM1
fromuser=NUM1
authuser=NUM1
secret=SECRET
host=sip.broadvoice.com
context=sip
fromdomain=sip.broadvoice.com
canreinvite=no
nat=never
dtmfmode=inband
[sip.broadvoice.com.home]
type=pe...
2011 Feb 28
3
Problems using unique function and !duplicated
...s from two or more
variables in a small R data.frame. I am trying to reproduce the SAS
statements from a Proc Sort with Nodupkey for those familiar with SAS.
Here's my example data :
test <- read.csv("test.csv", sep=",", as.is=TRUE)
> test
date var1 var2 num1 num2
1 28/01/11 a 1 213 71
2 28/01/11 b 1 141 47
3 28/01/11 c 2 867 289
4 29/01/11 a 2 234 78
5 29/01/11 b 2 666 222
6 29/01/11 c 2 912 304
7 30/01/11 a 3 417 139
8 30/01/11 b 3 108 36
9 30/01/11 c 2 288 96
I am trying to obta...
2005 Jul 28
1
Unexpected behavior in recode{car}
...me unexpected behavior.
Consider the following example:
## Begin cut-and-paste example
require( car )
set.seed(12345)
nn <- sample( c( 2, 4 ), size=50, replace=TRUE )
rr <- recode( nn, "2='TWO';4='FOUR'" )
table( rr, exclude=NULL )
ss <- recode( nn, "2='Num2';4='Num4'" ) # Doesn't work as expected
table( ss, exclude=NULL )
tt <- recode( nn, "2='TWO'; 4='Num4'" )
table( tt, exclude=NULL )
uu <- recode( nn, "2='Num2'; 4='FOUR'" )
table( uu, exclude=NULL )
## End cut-and-paste...
2012 Sep 20
1
aggregate help
...ALSE)
> z
id a1 a2
1 10 a x
2 20 b y
3 10 a x
4 30 c z
5 10 b z
6 20 b y
--8<---------------cut here---------------end--------------->8---
I want to get something like
--8<---------------cut here---------------start------------->8---
id a1.tot a1.val1 a1.num1 a1.val2 a1.num2 a2.tot a2.val1 a2.num1 a2.val2 a2.num2
10 3 "a" 2 "b" 1 3 "x" 2 "z" 1
20 2 "b" 2 <NA> 0 2 "y" 2 <NA> 0
30 1 "c" 1...
2010 Feb 01
1
How to repeat "for" function?
...m=matrix(c(0,0,0,0),4,1)
m2=matrix(c(0,2,0,0),4,1)
c4<-matrix(c(1.0,0.2,-0.5,0.3,0.2,1,0.2,-0.5,-0.5,0.2,1,0.2,0.3,-0.5,0.2,1),4,4,byrow=T)
set.seed(428)
X=mvrnorm(n,m2,c4)
X.pca<-princomp(X)
loadings(X.pca)
pc=X.pca$loadings[,1]
## Part B
num1=rep(1:n)
for(i in 1:n)num1[i]=pc[1]%*%X[i,1]
num2=rep(1:n)
for(i in 1:n)num2[i]=pc[2]%*%X[i,2]
num3=rep(1:n)
for(i in 1:n)num3[i]=pc[3]%*%X[i,3]
num4=rep(1:n)
for(i in 1:n)num4[i]=pc[4]%*%X[i,4]
den=rep(1:n)
for(i in 1:n)den[i]=pc%*%X[i,]
r1=num1/den
r2=num2/den
r3=num3/den
r4=num4/den
MLAV=sum(r2>r1 & r2>r3 & r2>r4)
MLAV
Best...
2003 Jun 23
1
strange problem
hi,
running dovecot-0.99.10-rc2 on NetBSD, client is Entourage on MacOS 9.2.
sylpheed on NetBSD does not show this behaviour.
--snip--
Jun 23 16:28:15 host imap(user): file mail-index.c: line 619 (mail_index_lookup_uid_range): assertion failed: (first_uid > 0 && last_uid > 0)
--snap--
any hints?
thanks,
TOM
-------------- next part --------------
A non-text attachment was
2011 Feb 16
1
confused by lapply
...#39;FUN' to the corresponding element
of 'X'.
I expect that when I do
> lapply(vec,f)
f would be called _once_ for each component of vec.
this is not what I see:
parse.num <- function (s) {
cat("parse.num1\n"); str(s)
s <- as.character(s)
cat("parse.num2\n"); str(s)
if (s == "N/A") return(s);
as.numeric(gsub("M$","e6",gsub("B$","e9",s)));
}
> vec
mcap
1 200.5B
2 19.1M
3 223.7B
4 888.0M
5 141.7B
6 273.5M
7 55.649B
> str(vec)
'data.frame': 7 obs. of 1 variable:
$...
2012 Dec 12
1
ggplot: geom_line with only pairs of points connected
...C) not be there.
What I've come up with is this (instead using geom_segment):
df <- data.frame(cat=LETTERS[1:4],num=rnorm(4))
dfdf <-cbind(df[seq(from=1,by=2,along.with=df),],df[seq(from=2,by=2,along.with=df),])
names(dfdf) <- c("cat","num","cat2","num2")
ggplot(df, aes(x=cat, y=num)) + geom_point() +
geom_segment(aes(x=cat,xend=cat2,y=num,yend=num2),data=dfdf)
Hoewever, in a more extended example (where df is more complex and
also contains factors used for grouping and faceting) this becomes a
bit cumbersome.
Is there a better way to do t...
2020 Aug 14
2
Another possible tracing feature for TableGen
...let D_field2 = -10102 in {
def rec1 : C<"arg1_val">, D<[13, 14, 15]> {
defvar var1 = -1;
defvar var2 = "base string";
int num = 42;
list<string> list_a;
string str = "Hello world!";
string from_var2 = var2 # " from var2";
int num2 = !mul(3, num);
let num = 43;
let str = from_var2 # " with let";
}
} // let
====================================================
~~~~~~~~~~~~~ Trace class P ~~~~~~~~~~~~~
<class's template args should be listed here>
~~~ No inherited classes
~~~ No pending lets
~~~ Local i...
2007 Dec 01
1
creating conditional means
Hi all-
I have a dataset (year, month, hour, co2(ppm), num1,num2)
[49,] 2006 11 0 383.3709 28 28
[50,] 2006 11 1 383.3709 28 28
[51,] 2006 11 2 383.3709 28 28
[52,] 2006 11 3 383.3709 28 28
[53,] 2006 11 4 383.3709 28 28
[54,] 2006 11 5 383.3709 28 28
[55,] 2006 11 6 383.3709 28 28
[56,] 2006 11...
2009 Aug 17
0
Call back DIALSTATUS is empty
...ked up the phone or not. It is coming as empty. Please help.
Here is my extensions_additional.conf file code:
[multi-dir-callback]
include => multi-dir-callback-custom
exten => _X.,1,Answer
exten => _X.,n,Playback(beep)
exten =>
_X.,n,DeadAGI(agi://127.0.0.1/callback_handler?num2=${EXTEN}&callid=${CALL_I
D}&num1=${num1}&state=${STATE})
exten => _X.,n,Goto(${EXTEN},1)
exten =>
hangup,1,DeadAGI(agi://127.0.0.1/callback_handler?num2=${EXTEN}&callid=${CAL
L_ID}&num1=${num1}&state=${STATE})
; end of [multi-dir-callback]
Here is the code fr...
2009 Aug 07
1
Gauss-Laguerre using statmod
I believe this may be more related to analysis than it is to R, per se.
Suppose I have the following function that I wish to integrate:
ff <- function(x) pnorm((x - m)/sigma) * dnorm(x, observed, sigma)
Then, given the parameters:
mu <- 300
sigma <- 50
m <- 250
target <- 200
sigma_i <- 50
I can use the function integrate as:
> integrate(ff, lower= -Inf, upper=target)
2017 Aug 16
3
LLVM JIT Compilation
...> My understanding of JIT is it is like llc; it takes optimized bit code
> (generated via opt) and compiles it at run time instead of static
> compilation. for example i have a loop which adds 2 user input numbers. so
> my cpp file becomes:
>
> int main()
> {
> num1[1000], num2[1000];
> //take input in these arrays at run time using scanf.
>
> scanf("%d",num1);
> scanf("%d",num2);
>
> for (int i=0;i<1000;i++);
> {
> num1+num2;
> }
>
> so if i pass this through opt for auto vectorization. i keep vector
> width=32,...
2004 Sep 01
5
dtmf problem
Hello!
I have asterisk updated from CVS on 31/8/2004 with
sample configuration. I have just changed the
sip.conf to register asterisk with sip proxy in out
intranet.
Then I can successfully make call to asterisk and go
to demo IVR, but no response to dtmfs.
I try to make call from several sip phones: Cisco7960,
Ata186, Snom200. All of them send telephone-event in
INVITE, but asterisk answers
2006 Oct 30
4
read.fwf and header
Hi!
I have data (also in attached file) in the following form:
num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt
1 1 f q 1900-01-01 1900-01-01 01:01:01
2 1.0 1316666.5 2 a g r z 1900-01-01 01:01:01
3 1.5 1188830.5 3 b h s y 1900-01-01 1900-01-01 01:01:01
4 2.0 1271846.3 4 c i t x 1900-01-01 1900-01-01 01:01:01
5 2.5 829737.4 d...
2006 Oct 30
4
read.fwf and header
Hi!
I have data (also in attached file) in the following form:
num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt
1 1 f q 1900-01-01 1900-01-01 01:01:01
2 1.0 1316666.5 2 a g r z 1900-01-01 01:01:01
3 1.5 1188830.5 3 b h s y 1900-01-01 1900-01-01 01:01:01
4 2.0 1271846.3 4 c i t x 1900-01-01 1900-01-01 01:01:01
5 2.5 829737.4 d...
2013 Jun 11
1
mapply on multiple data frames
...t of multiple data frames. All data frames have the same structure.
Here is my code so far:
f<-function(x,y) {
test<-t.test(x$col1[x$col3=="num",],v$col2[x$col3=="num",],paired=T,alternative="greater")
out<-test$p.value
return(out)
}
all_nums<-list(num1,num2,num3,num4)
all_dfs<-list(df1,df2,df3,df4)
mapply(f,all_dfs,all_nums)
This tells me that $ operator is invalid for atomic vectors. I have tried shifting to notation using [ ,] to denote columns, but that gives me this error: incorrect number of dimensions.
Thank you in advance,
Elizabeth