search for: dt2

Displaying 20 results from an estimated 39 matches for "dt2".

Did you mean: dt
2009 Sep 03
1
Output from as.windrose() in oce package baffles me
I'm having trouble understanding the output from as.windrose(). For one thing, data on a boundary between sectors seem to be left out of the counts. I assume that explains the missing point in the output below (angle 45). Shouldn't one side of each sector interval be open, to include values such as my 45 in the example? Also, why does the angle 180 in my input apparently not result in
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
...ta.table) a <- 1:10 b <- c("a","b","c","d","e","f","g","h","i","j") c <- seq(1.1, .2, length = 10) dt1 <- data.table(a,b,c) str(dt1) col.classes <- sapply(dt1, class) head(col.classes) dt2 <- subset(dt1, typeof = "double" | "numeric") str(dt2) dt2?? #? not subset dt2 <- dt1[, list(typeof = "double")] str(dt2) class_data <- dt1[,sapply(dt1,is.integer) | sapply(dt1, is.numeric)] class_data sum(class_data) typeof(class_data) names(class_data) str(...
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user to pass in length.out =3D NULL, despite the fact that this is the = default argument. For example: > dt1 <- as.Date("2004-12-31") > dt2 <- as.Date("2005-12-31") > seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month") Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D "day") :=20 'length.out' must be of length 1 This might be an issue if I want to wrap seq.Date in another function...
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
...c("a","b","c","d","e","f","g","h","i","j") > c <- seq(1.1, .2, length = 10) > dt1 <- data.table(a,b,c) > str(dt1) > col.classes <- sapply(dt1, class) > head(col.classes) > dt2 <- subset(dt1, typeof = "double" | "numeric") > str(dt2) > dt2 # not subset > dt2 <- dt1[, list(typeof = "double")] > str(dt2) > class_data <- dt1[,sapply(dt1,is.integer) | sapply(dt1, is.numeric)] > class_data > sum(class_data) > ty...
2010 Mar 03
1
empirical copula code
Hi all, I have this data set: ## Empirical copula ## dt1 = ranking ## dt2 = observed uniform data associated with the ranking   Sample data, > dt1         S_i   R_i  [1,]   7.0  10.0  [2,] 232.5 440.5  [3,] 143.0 141.5  [4,] 272.5 222.0  [5,]  46.0  34.0  [6,] 527.0 483.0  [7,] 420.5 563.5  [8,]  23.5  16.5  [9,]  56.5  68.5 [10,] 341.5 382.5   > dt2       unisk1...
2013 Aug 16
1
as.Date.character speed improvement suggestion
...ion length character vector of 1000 unique dates ## By considering only unique values, speed is >250x faster > dtch <- format(sample(Sys.Date()-1:1000, 1e6, replace=TRUE)) > system.time(dt1 <- as.Date.character(dtch)) user system elapsed 12.630 23.628 36.262 > system.time(dt2 <- as.Date.character2(dtch)) user system elapsed 0.117 0.019 0.136 > identical(dt1, dt2) [1] TRUE ## Example2: In a "worst case" scenario of a 1,000,002 length character of 1,000,001 unique dates ## the new function is not any slower (within error). > dtch <- for...
2010 Aug 24
2
How to remove rows based on frequency of factor and then difference date scores
Hello- A basic question which has nonetheless floored me entirely. I have a dataset which looks like this: Type ID Date Value A 1 16/09/2020 8 A 1 23/09/2010 9 B 3 18/8/2010 7 B 1 13/5/2010 6 There are two Types, which correspond to different individuals in different conditions, and loads of ID labels (1:50)
2009 Nov 02
3
question about difference in date objects
Hi R Community: I want to take the difference in two dates: dt2 - dt1. But, I want the answer in months between those 2 dates. Can you advise me? Please respond to: pzs6 at cdc.gov Thank you! Phil Smith Centers for Disease Control and Prevention
2023 Jan 26
2
Resumen de R-help-es, Vol 167, Envío 10
...= sample(c("1","0"), 10, TRUE)) dt[,":="(seq=.I)] setcolorder(dt,"seq") dt1 <- melt(dt,id.vars=1,measure.vars=2:ncol(dt),variable.name="vrb", value.name="vl") dt1[,":="(vrb_nm=str_sub(vrb,end=2),vrb_tp=str_sub(vrb,start=-1))] dt2 <- dcast(dt1,seq+vrb_nm~vrb_tp,fun.aggregate=\(x) paste0(x,collapse="|"),value.var="vl") dt2[,":="(c=fifelse(a=="1"|b=="1","1","0"))] dt3 <-dcast(dt2,seq~vrb_nm,fun.aggregate=\(x) paste0(x,collapse="|"),value.var=...
2011 Dec 07
2
plotting and coloring longitudinal data with three time points (ggplot2)
...assessment and how much that was actual treatment. Below is an example (I call it the not-working example) df2 <- data.frame( ?date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], ?patient2 = factor(rep(1:26, 3), labels = LETTERS) ) df2 <- df2[order(df2$date2), ] dt2 <- qplot(date2, patient2, data=df2, geom="line") dt2 + scale_x_date(major="months", minor="weeks") df2[ which(df2$patient2=='B'), c("patient2", "date2")] If someone can point me in a direction or tell me what I am doing wrong or if the...
2008 Jun 14
1
restricted coefficient and factor in linear regression.
...P) model in R. My colleague wrote SAS code as follows: ** procedures for creating dummy variables are omitted ** ** di# and dt# are dummy variables for industry and time ** data a2; merge a1 a2 a; by id yr; proc sysnlin maxit=100 outest=beta2; endogenous y; exogenous l e k di1-di12 dt2-dt10; parms a0 0.94 al -0.14 ae 1.8 ak -0.9 b1 0 b2 0 b3 0 b4 0 b5 0 b6 0 b7 0 b8 0 b9 0 b10 0 b11 0 b12 0 c2 0 c3 0 c4 0 c5 0 c6 0 c7 0 c8 0 c9 0 c10 0; y=a0+al*l+ae*e+ak*k +(b1*di1+b2*di2+b3*di3+b4*di4+b5*di5+b6*di6 +b7*di7+b8*di8+b9*di9+b10*di10+b11*di11+b12...
2013 Mar 14
2
Grep with wildcards across multiple columns
...reps across columns. I'd prefer to use data.table since it's so much faster than plyr and I have 159 different sets of parameters to run through, but I get the same error setting it up either way: # Doesn't work library(data.table) dt <- data.table(df) eval(parse(text=paste( "dt2 <- dt[", "grep('", par.fund, "', fund) & ", "grep('", par.func, "', func) & grep('", par.obj, "', obj)", ", sum(amount), by=c('code', 'year')]" , sep=""))) # Warning mes...
2018 Jan 28
0
Polly Dependency Analysis in MyPass
...auto &SE2 = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); auto &LI2 = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); auto &AA2 = getAnalysis<AAResultsWrapperPass>().getAAResults(); auto const &DL2 = F.getParent()->getDataLayout(); auto &DT2 = getAnalysis<DominatorTreeWrapperPass>().getDomTree(); auto &AC2 = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F); Result.reset(new ScopInfo{DL2, SD2, SE2, LI2, AA2, DT2, AC2}); polly::DependenceInfoWrapperPass dp; auto &SI = *getAnalysis<polly::ScopInfo...
2018 Jan 28
4
Polly Dependency Analysis in MyPass
Hello, I need to analyze dependencies in my llvm ir by using polly. i created a new pass called mypass there i added polly dependency analysis pass but when i execute this pass in gdb i get no data. Why is that so? My code is follows; namespace { struct mypass : public FunctionPass { static char ID; mypass() : FunctionPass(ID) { } virtual bool runOnFunction(Function &F) {
2018 Jan 28
1
Polly Dependency Analysis in MyPass
...= getAnalysis<ScalarEvolutionWrapperPass>().getSE(); > auto &LI2 = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); > auto &AA2 = getAnalysis<AAResultsWrapperPass>().getAAResults(); > auto const &DL2 = F.getParent()->getDataLayout(); > auto &DT2 = getAnalysis<DominatorTreeWrapperPass>().getDomTree(); > auto &AC2 = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F); > > Result.reset(new ScopInfo{DL2, SD2, SE2, LI2, AA2, DT2, AC2}); > > > polly::DependenceInfoWrapperPass dp; > > auto &...
2010 Sep 27
8
pygrub question
...create domU on this system, I see the pygrub boot menu but then an error message comes up: Error: (2, ''Invalid kernel'', ''xc_dom_find_loader: no loader found\n'') When I use pygrub directly (ie. rather than xm create), I get this message: # pygrub /dev/d/xm.dt2 linux (kernel /var/run/xend/boot/boot_kernel.jZIjuL)(ramdisk /var/run/xend/boot/boot_ramdisk.pQPLZC)(args "root=/dev/xvda1 ro") Any suggestions for how to further diagnose this? kind regards, Jan _______________________________________________ Xen-users mailing list Xen-users@lists....
2003 Mar 14
3
logistic regression
...ta. analyses on summarised data (count of yes/no values) of the huge file. Normally, summarised data file short and R could handle it. Then I used this command. > lo <-glm(hey.count~as.factor(jeo)+as.factor(eg)+as.factor(kon)+ as.factor(yol)+ as.factor(aks)+as.factor(fay),family=poisson,data=dt2) as you see I used count value of yes/no data as independent data. Is it good idea to use this method instead of binomial logistic regression ? what do you suggest more ? thanks in advance -- Ahmet Temiz Geological Engineer General Directorate of Disaster Affairs TURKEY ___________________...
2013 Jun 08
1
splitting a string column into multiple columns faster
Hello! I have a column in my data 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))
2023 Jan 27
0
Resumen de R-help-es, Vol 167, Envío 10
...> setcolorder(dt,"seq") > > > > > > dt1 <- melt(dt,id.vars=1,measure.vars=2:ncol(dt),variable.name="vrb", > > > value.name="vl") > > > dt1[,":="(vrb_nm=str_sub(vrb,end=2),vrb_tp=str_sub(vrb,start=-1))] > > > dt2 <- dcast(dt1,seq+vrb_nm~vrb_tp,fun.aggregate=\(x) > > > paste0(x,collapse="|"),value.var="vl") > > > dt2[,":="(c=fifelse(a=="1"|b=="1","1","0"))] > > > dt3 <-dcast(dt2,seq~vrb_nm,fun.aggregate=\(x...
2023 Jan 28
0
Resumen de R-help-es, Vol 167, Envío 10
...> setcolorder(dt,"seq") > > > > > > dt1 <- melt(dt,id.vars=1,measure.vars=2:ncol(dt),variable.name="vrb", > > > value.name="vl") > > > dt1[,":="(vrb_nm=str_sub(vrb,end=2),vrb_tp=str_sub(vrb,start=-1))] > > > dt2 <- dcast(dt1,seq+vrb_nm~vrb_tp,fun.aggregate=\(x) > > > paste0(x,collapse="|"),value.var="vl") > > > dt2[,":="(c=fifelse(a=="1"|b=="1","1","0"))] > > > dt3 <-dcast(dt2,seq~vrb_nm,fun.aggregate=\(x...