search for: xx1

Displaying 20 results from an estimated 46 matches for "xx1".

Did you mean: 0x1
2008 May 19
1
Select certain elements from dataframe
..."111KF4319036131" "112KF4319097194" . . . [701] "821KS4242126913" "822KS4242026026" "823KS4242003122" "824IHT06020" [705] "825IHT06020" "826IHT06005" "827IHT06005" My subcluster looks like this > xx1 xx1 [1] 101KF4319097339 102KF4319101170 103KF4319047549 104KF4319046389 [5] 125KF4319063638 126KF4319102180 127KF4319107122 128KF4319019607 [9] 135KF4319037854 138KF4319050003 140KF4319069150 152KF4319109279 . . . [125] 795KS4242028634 797KS4242032582 798KS4242035374 127 Levels: 101KF431909...
2011 Jan 30
1
Extract subsets of different and unknown lengths from huge dataset
...value is greater than 0, this is the start of an event of unknown length (unknown number of values). And the end of an event again is defined by at least 24 values being equal to 0. I want to subset the single events for the purpose of examining the maximum value within each event. I tried: > xx1 <- read.table(pipe("cut -f2 corrected_data.txt"),header=T) > nrow(xx1) [1] 2500000 > start1 <- data.frame(start=rep("NA",length.out=nrow(xx1))) > stop1 <- data.frame(stop=rep("NA",length.out=nrow(xx1))) > max.xx1 <- data.frame(max.xx=rep("N...
2009 Mar 28
1
Error in R??
Can someone explain why I am getting the following error: in the r code below? Error in solve.default(diag(2) + ((1/currvar) * (XX1 %*% t(XX1)))) : system is computationally singular: reciprocal condition number = 0 In addition: There were 50 or more warnings (use warnings() to see the first 50) The R code is part of a bigger program. ##sample from full conditional distribution of Si #Prob(Si = 1...
2023 Oct 31
1
weights vs. offset (negative binomial regression)
...ould *not* check overdispersion of the raw data > (i.e., the *marginal distribution* of the data, you should check > overdispersion of a fitted (e.g. Poisson) model, as below. > > ? ?cheers > ? ? Ben Bolker > > > edata <- data.frame(Catch, Effort, xx1, xx2, xx3) > > ## graphical exploration > > library(ggplot2); theme_set(theme_bw()) > library(tidyr) > edata_long <- edata |> pivot_longer(names_to="var", cols =-c("Catch", > "Effort")) > ggplot(edata_long, aes(va...
2004 Oct 28
1
gsub() on Matrix
Hi, Suppose I've got a matrix, and the first few elements look like "x1 + x3 + x4 + x5 + x1:x3 + x1:x4" "x1 + x2 + x3 + x5 + x1:x2 + x1:x5" "x1 + x3 + x4 + x5 + x1:x3 + x1:x5" and so on (have got terms from x1 ~ x14). If I want to replace all the x1 with i7, all x2 with i14, all x3 with i13, for example. Is there an easy way? I tried to put what I want
2004 May 30
1
What's wrong with this simple code???
...ut, please have a look and help me out. thank you! Note: this is in SPLUS, not R. I have following code *********************************** modfit<-function(yir,yew, ft) { n<-length(yew) yew<-yew[1:(n-1)] yy<-yir-ft xx<-yew-ft n<-length(xx) xx0<-xx[2:n] yy0 <-yy [2:n] xx1<-xx[1:(n-1)] fit <- garch(yy0~xx0 + xx1+var.in.mean, ~garch(1,1),cond.dist='ged') summary(fit) } fs1hca<-modfit(s1hca.r, s1hca.ew, zfr) **************error message is *************** Problem in garch(yy0 ~ xx0 + xx1 + var.in.mean, ~ ..: Object "xx0" not found Use tr...
2008 Jul 26
0
gam() of package "mgcv" and anova()
R-users E-mail: r-help@r-project.org Hi! R-users. A simple object as below was created to see how gam() of package "mgcv" and anova() work. function() { library(mgcv) set.seed(12) nd <- 100 xx1 <- runif(nd, min=1, max=10) xx1 <- sort(xx1) yy <- sin(xx1)+rnorm(nd, mean=5, sd=5) data1 <- data.frame(x1=xx1, y=yy) fit1 <- gam(y~s(x1, k=5), data=data1, family=gaussian) out1 <- anova(fit1) print(out1) } The results is: Family: gaussian Link function: identity For...
2011 Dec 05
1
plot mixed variables
My data consists of a numeric (yy) variable and a categorical (xx) variable, as shown below. xx = c(rep("C", 5), rep("D",5)) yy = rnorm(10, 0, 4) xx1 = as.integer(as.factor(xx))   plot(xx1, yy, ylim = c(-13.5, 4), col="blue")   I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis.   Could someone help me with an R code on how to go about this. Thank you in...
2012 Mar 02
3
speed up merge
Hello, I have a nasty loop that I have to do 11877 times. The only thing that slows it down really is this merge: xx1 = merge(dt,ua_rd,by.x=1,by.y= 'rt_date',all.x=T) Any ideas on how to speed it up? The output can't change materially (it works), but I'd like it to go faster. I'm looking at getting around the loop (not shown), but I'm trying to speed up the merge first. I'll post regar...
2011 Nov 17
1
Vectorizing for weighted distance
Hi All, I am trying to convert the following piece of matlab code to R: XX1 = sum(w(:,ones(1,N1)).*X1.*X1,1); #square the elements of X1, weight it and repeat this vector N1 times XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2, weigh and repeat this vector N2 times X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted &...
1999 Feb 16
1
Missing tick marks bug on alpha solved
...g like: > plot(0:1,axes=FALSE) > axis(1,1:2) The problem is in X11_Line(...) from .../src/unix/devX11.c, which is so short I've included the whole function below: static void X11_Line(double x1, double y1, double x2, double y2, int coords, DevDesc *dd) { double xx1, yy1, xx2, yy2; <----------- should be int! x11Desc *xd = (x11Desc *) dd->deviceSpecific; /* In-place conversion ok */ GConvert(&x1, &y1, coords, DEVICE, dd); GConvert(&x2, &y2, coords, DEVICE, dd); xx1 = (int) x1; yy1 = (int) y1; xx2...
2007 Dec 02
2
Optimised qmf_synth and iir_mem16
...r7, sp, #36 @ r0 = x1, r1 = x2, r2 = a, r3 = y ldmia r7, { r4-r7 } @ r4 = N, r5 = M, r6 = mem1, r7 = mem2 add r8, r4, r5 sub r9, sp, r8 @ r9 = sp - (N + M >> 1) = xx2 sub r8, r9, r8 @ r8 = r9 - (N + M >> 1) = xx1 str sp, [r8, #-4] @ Stack old sp sub sp, r8, #4 @ Update sp add r0, r0, r4 @ x1 += N >> 1 add r1, r1, r4 @ x2 += N >> 1 mov r14, r4 @ Loop counter is N 0: @ Backwards copy x1 an...
2012 May 12
2
ggplot simple question.
I have a matrix like this Name 1 2 3 4 5 NM_001039514 1.033557047 0.7469879518 0.9004524887 0.8613861386 0.7952499048 NM_001039723 1.0759493671 1.2315789474 0.8666666667 1.1142857143 0.9428011471 NM_001042605 0.9897435897 0.8870431894
2008 Dec 16
8
sliding window over a large vector
Hi all, I have a very large binary vector, I wish to calculate the number of 1's over sliding windows. this is my very slow function slide<-function(seq,window){ n<-length(seq)-window tot<-c() tot[1]<-sum(seq[1:window]) for (i in 2:n) { tot[i]<- tot[i-1]-seq[i-1]+seq[i] } return(tot) } this works well for for reasonably sized vectors. Does
2010 Aug 17
3
predict.lm, matrix in formula and newdata
Dear all, I am stumped at what should be a painfully easy task: predicting from an lm object. A toy example would be this: XX <- matrix(runif(8),ncol=2) yy <- runif(4) model <- lm(yy~XX) XX.pred <- data.frame(matrix(runif(6),ncol=2)) colnames(XX.pred) <- c("XX1","XX2") predict(model,newdata=XX.pred) I would have expected the last line to give me the predictions from the model based on the new data given in XX.pred... but all I get are in-sample fits along with a warning "'newdata' had 3 rows but variable(s) found have 4 rows&q...
1997 Aug 04
0
R-alpha: 0.50-a1 -- "more lost comments"
...hat they >> are shifted to just before their statements. Comments after the >> last statement of a function are lost. ------------------------------------------------------------ I think we could live with the above advertized behavior. Unfortunately, in the following case 'xx1' even a comment BEFORE the last statement is lost ((because the last statement is so trivial ???, it is NOT lost in the 'xx1a' example (and in others I tried)) : This is in plain 0.50-a1 : > xx1 <- function(x) { + ##--- a Start-comment ... (lost in 0.50-a1) + x + } &gt...
2003 Jul 08
2
Can anybody help me on this?
Hi there: I have this configuration: |-----[Server 2] | [Internet]--------[Router]----------[Switch]------------ [Server 1] | |-----[PC1] | |-----[PC2] | |-----[PC3] Server 1 has IP 216.251.XXX.XX1 Server 2 has IP 216.251.XXX.XX2 PC1 has IP 216.251.XXX.XX3 PC2 has IP 192.168.XXX.1 PC3 has IP 192.168.XXX.2 How do I configure shorewall in SERVER 2 to block to/from the Internet Port 22 (ssh), but do not block port 22 from PC1 and PC2 and PC3 ??? Currently I have shorewall confufured like &quot...
2007 Oct 14
1
iPhone 1.1.1 problems.
...g back and forth in a number of ways, but haven't been able to see the contents. I tried turning on raw logging, but don't get log files for accesses from the iPhone. What I get are lines like so: Oct 13 00:08:34 bhuda dovecot: imap-login: Disconnected: rip=xxx.xxx.xxx.xx2, lip=xxx.xxx.xxx.xx1, TLS Turning off SSL both ways, and the message changes to: Oct 13 18:21:38 bhuda dovecot: imap-login: Aborted login: rip=xxx.xxx.xxx.xx2, lip=xxx.xxx.xxx.xx1 Tweaking the logging in the firewall reveals something interesting: apparently the phone makes the connection to 993, then dovecot drops...
2012 Mar 05
1
index instead of loop?
...;2009-03-25"), by = "day") dt = sapply(dt1, as.character) fin = dt ck_rows = length(dt) bad = character(0) start_t_all = Sys.time() for(cn in 1:ncol(ua)){ uac = ua[,cn] tkr = colnames(ua)[cn] rdc = rd[,cn] ua_rd = cbind(uac,rdc) colnames(ua_rd) = c(tkr,'rt_date') xx1 = merge(dt,ua_rd,by.x=1,by.y= 'rt_date',all.x=T) xx = as.character(xx1[,2]) values <- c(NA, xx[!is.na(xx)]) ind = cumsum(!is.na(xx)) + 1 y <- values[ind] if(ck_rows == length(y)){ fin = data.frame(fin,y) }else{ bad = c(bad,tkr) } } colnames(fin) = c('daily_...
2002 Mar 22
3
heteroskedasticity-robust standard errors
I am trying to compute the white heteroskedasticity-robust standard errors (also called the Huber standard errors) in a linear model, but I can't seem to find a function to do it. I know that the design library in S+ has something like this (robcov?), but I have not yet seen this library ported to R. Anyone know if there is already a function built into R to do this relatively simple job?