similar to: confused by lapply

Displaying 20 results from an estimated 300 matches similar to: "confused by lapply"

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
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,
2005 Sep 05
2
USING TWO ACCOUNTS WITH BROADVOICE
Hi, I have two accounts with broadvoice. Now, I want to be able to distinguish between them. I though that this would be simple by adding "/EXTEN" at the end of the register statement. For example: register => num1:pass@sip.broadvoice.com/1000 Unfortunately, this is not working. When I call into my box I hear busy tone. My config looks like this: [root@voip asterisk]# cat sip.conf
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
2010 Feb 01
1
How to repeat "for" function?
Dear Users, I have one problem here, I tried many time and even read a few notes on writing function but still..... Can anyone help me on how to simplify Part B (please refer the programming below), so that I don't have to repeat the calculation of "num" and "r" ? Thank you very much..every help is very much appreciated... ## Part A n=1400 m=matrix(c(0,0,0,0),4,1)
2011 Feb 28
3
Problems using unique function and !duplicated
Hi, I am trying to simultaneously remove duplicate variables 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
2012 Sep 20
1
aggregate help
I want to count attributes of IDs: --8<---------------cut here---------------start------------->8--- z <- data.frame(id=c(10,20,10,30,10,20), a1=c("a","b","a","c","b","b"), a2=c("x","y","x","z","z","y"),
2009 Aug 17
0
Call back DIALSTATUS is empty
Hi, Here is my problem. I am trying to get the Status of the call if the user picked 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 =>
2005 Aug 03
2
using weighted.mean with tapply()
I am trying to calculate the weighted mean for a of 10 deciles and I get an error: > decile <- tapply(X=mat$trt1m, INDEX=mat$Rank, FUN=weighted.mean, w=mat$mcap) Error in FUN(X[[1]], ...) : 'x' and 'w' must have the same length All three of my inputs have the same length, as shown below, and the weighted.mean calculation works by itself, just not in tapply() >
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 7 383.3709 28 28 [57,] 2006
2017 Aug 16
3
LLVM JIT Compilation
ok i have managed to compile using lli (jit) as follows: but i dont get assembly file? my sum-main.c file is: #include <stdio.h> #include<stdlib.h> int sum(int a, int b) { return a + b; } int main(int argc, char** argv) { printf("sum: %d\n", sum(atoi(argv[1]), atoi(argv[2])) + sum(atoi(argv[1]), atoi(argv[2]))); return 0; } and i used the following steps to compile. clang
2013 Jun 11
1
mapply on multiple data frames
Hi all- I am wondering about using the mapply function to multiple data frames. Specifically, I would like to do a t-test on a subset 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
2002 Nov 27
1
read.table: colClasses when num. of columns is unknown
Hi, I am looking for a way to read tables that have general structure of characterTag num1 num2 ... i.e. one character column followed by an unknown to the caller (but fixed throughout the file) number of numeric columns. I wanted to improve the speed of read.table by using colClasses, but that seemed to require knowledge of the actual number of columns in the file. For example I tried
2011 Feb 15
4
string parsing
I am trying to get stock metadata from Yahoo finance (or maybe there is a better source?) here is what I did so far: yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s="; stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY","F"); # just some samples socket <-
2006 Mar 03
0
Fw: 2 real phone numbers on one SIP account
Hallo! I have problem with incoming calls on 2 phone numbers registered on same SIP provider account. I've tried averything and nothing seems to work. No matter what I do asterisk system refuses differ betwen them and both got connected to the same extensions. I've tride with: registration => num1:pass@provider/ext1 registration => num2:pass:num1@provider/extt in sip.conf and
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 j u w 1900-01-01 6 3.0
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 j u w 1900-01-01 6 3.0
2005 Jul 28
1
Unexpected behavior in recode{car}
Thanks to the R creators for such a great statistical system. Thanks to the R help list, I have (finally) gotten far enough in R to have a question I hope to be worth posting. I'm using the recode function from John Fox's car package and have encountered some unexpected behavior. Consider the following example: ## Begin cut-and-paste example require( car ) set.seed(12345) nn <-
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
2012 Dec 12
1
ggplot: geom_line with only pairs of points connected
Dear list, I've been using plotmeans {gplots} a lot before, and found the "connect" argument to be quite useful. I've moved to ggplot for several reasons, but would still like to connect lines conditionally, somehow. Is it possible to do? Small example: df <- data.frame(cat=LETTERS[1:4],num=rnorm(4)) ggplot(df, aes(x=cat, y=num)) + geom_point() +