similar to: concatenating two vectors

Displaying 20 results from an estimated 600 matches similar to: "concatenating two vectors"

2009 Jan 30
2
reshape with two time variables
I have a data frame in wide format that I'd like to convert to long format. For example, in wide format I have: id A1B1 A1B2 A2B1 A2B2 1 1 400 475 420 510 2 2 390 500 470 472 3 3 428 512 555 610 4 4 703 787 801 822 5 5 611 634 721 705 6 6 543 522 612 788 7 7 411 488 506 623 8 8 654 644 711 795 A is one repeated-measures variable with levels 1 and 2. B is a second repeated-measures variable
2010 Jan 03
1
Anova in 'car': "SSPE apparently deficient rank"
I have design with two repeated-measures factor, and no grouping factor. I can analyze the dataset successfully in other software, including my legacy DOS version BMDP, and R's 'aov' function. I would like to use 'Anova' in 'car' in order to obtain the sphericity tests and the H-F corrected p-values. I do not believe the data are truly deficient in rank. I
2012 Mar 21
2
Type II and III sum of squares (R and SPSS)
To whom it may concern I made some analysis with R using the command Anova. However, I found some problmes with the output obtained by selecting type II o type III sum of squares. Briefly, I have to do a 2x3 mixed model anova, wherein the first factor is a between factor and the second factor is a within factor. I use the command Anova in the list below, because I want to obtain also the sum
2013 Mar 13
5
string split at xth position
Hi, I have a vector of strings like: c("a1b1","a2b2","a1b2") which I want to spilt into two parts like: c("a1","a2","a2") and c("b1","b2,"b2"). So there is always a first part with a+number and a second part with b+number. Unfortunately there is no separator I could use to directly split the vectors.. Any idea
2004 Jun 15
4
"Glueing" factors together
Hi folks, Suppose I have a series of cases each with categorical factors A, B. What is the best way to "glue" A and B together into a single factor? For example, given A0 B1 ... A1 B1 ... A0 B2 ... A1 B0 ... A0 B0 ... A1 B2 ... then I'd like to end up with a single factor with levels A0B0, A0B1, A0B2, A1B0, A1B1, A1B2 according to all the combinations which actually occur in
2010 Jul 02
4
Some questions about R's modelling algebra
Hi all, In preparation for teaching a class next week, I've been reviewing R's standard modelling algebra. I've used it for a long time and have a pretty good intuitive feel for how it works, but would like to understand more of the technical details. The best (online) reference I've found so far is the section in "An Introduction to R"
2012 Sep 16
4
two questions about character manipulation
Dear all, I want to manipulate a character string such as ex<-"cbind(data$response1,data$response2)" in R in two ways: 1) extracting the "response1" portion of ex 2) replacing "$" with "." I am wondering that is it possible efficiently doing these in R? Best Ozgur -- View this message in context:
2012 Mar 03
3
submission of some functions to base package
Dear all, Actually I could not decide who to contact, then decided to post here. If not appropriate sorry for that. I have written some functions in R which might be supposed to available in the base package but not available. I am wondering that how can I submit those functions to that package? Best Ozgur ----- ************************************ Ozgur ASAR Research Assistant Middle East
2012 May 31
2
Loop question
Hello, I have a dataframe (Lx) with 5 Lb, and 5 Lw variables. I want to create several variables according to the loop presented below (data attached). Lx <- read.csv("Lx.csv", header=T, sep=",") for (i in 1:20) { Lx$sb1[i] <- Lx$Lb1[i+1]/Lx$Lb1[i] Lx$sb2[i] <- Lx$Lb2[i+1]/Lx$Lb2[i] Lx$sb3[i] <- Lx$Lb3[i+1]/Lx$Lb3[i] Lx$sb4[i] <-
2012 May 31
1
Warning message: numerical expression has 1000 elements: only the first used
Hi, Your mistake seems to be in sum(v[1:x]) You create "x" as a vector but your treat it as a single number. v[1:x] expects "x" to be a single number and only considers its first element which is 1. If I understand your query correctly, the following might handle your problem: sum.vec <-NULL for (x in 1:1000){ t <- rbinom(1000, 1, 0.5) v <- replace(t,t==0,-1)
2012 Jun 28
4
remove descriptions from output
Dear R users, I'd like to remove some descriptions when I use "filter". > filter(1:10, rep(1, 3)) Time Series: Start = 1 End = 10 Frequency = 1 [1] NA 6 9 12 15 18 21 24 27 NA That is, I want only this [1] NA 6 9 12 15 18 21 24 27 NA Thank you in advance. Kathie -- View this message in context:
2012 May 27
7
Customized R Regression Output?
Hello R-Experts, I am facing the problem that I have to estimate several parameters for a lot of different dependent variables. One single regression looks something like this: y = beta0 + beta1 * x1 + beta2 * x2 + beta3 * x1 * x2 + beta4 * x4 + beta5 * lag(x4,-1) where y is the dependent variable and xi are the independent ones. Important to me are the different estimates of betai and their
2012 Jun 28
3
Error: could not find function
Hi Do I have to load/download the whole package over and over again everytime when I use the R-Project? It often prompt me the error message "could not find function"- but I'm rather sure I have used the function before so I'm not entirely sure it couldn't find it again when I shut down the computer or so. Is it to do with directory or clashing with other software? Any
2012 May 23
2
Special characters in an R package manual
Dear all, I have some trouble with special characters while building my R package. I tried to follow the usual LATEX format, but could not fix the problem: For instance, for "greater than or equal", I tried "\geq", but R says that this is an unknown macro. Could anyone direct me how to solve this issue? Best Ozgur ----- ************************************ Ozgur ASAR
2012 May 26
3
How to measure level of similarity of two data frames
Hi group, I've been thinking of calculating euclidean distance between each column of a data frames that each consists of standardized numerical columns. However, I don't know if there's a way of summarizing the overall distance by some kind of metrics. If anyone know a proper way of doing so and/or a package I would greatly appreciate your suggestions. Thanks very much! Kel --
2012 May 28
1
simulation of levene's test
hello, I try to run simulation of levene's test to find the p-value but the error of replacement has length zero occur, could anyone help me to fix this problem? asim <- 1000 pv<-rep(NA,asim) for(i in 1:asim) {print(i) set.seed(i) g1 <- rnorm(20,0,2) g2 <- rnorm(20,0,2) g3 <- rnorm(20,0,2) x <- c(g1,g2,g3) group<-as.factor(c(rep(1,20),rep(2,20),rep(3,20))) library(Rcmdr)
2012 Apr 14
2
how to divide data by week
Dear list users, I have a data frame as below specified. From the 1st of May to the 30th of September of several years (e.g. from 2004 to 2011) I have a frequency of accidents. I need the mean of accidents divided by weeks (i.e. the mean of accidents from the 1st to the 7th of May of all the years, from the 8th to the 14th of May, ..., from the 29th to the 31st of May, from the 1st to the 7th of
2006 Apr 10
3
SE estimates for treatment groups from nlme
I am wondering how to obtain SE estimates for fixed effects from a nonlinear mixed effects model? I have fixed effects corresponding to three factors A, B and C with 2, 3 and 3 levels respectively. I have fit a model of the following general form: nlme1<-nlme(y~ SasympOrig(x, Asym, lrc), data=df, fixed=list(Asym~A*B*C, lrc~A*B*C), start=c(fixef(ETR.nlme)[1], rep(0,17), fixef(ETR.nlme)[2],
2006 Dec 06
3
HVM memory upper limit
Hello, I''m trying to create a HVM virtual machine (windows guest) with 3G of memory but this isn''t working. Xen create the domain but nothing happens (the OS don''t start and the cpu time remains 0). Things start to work with 2000MB or below. Is there some kind of upper limit for HVM virtual machines? I''m using a Dell PowerEdge 8250 machine with 16GB of memory.
2010 Dec 13
2
help on SAS Macro in R
Dear Researchers, I am looking for to read a SAS macro in R. Although I searched it on web, I couldn’t find anything. Can you help me or direct me? Thank you for your interest and patience. Best. Ozgur [[alternative HTML version deleted]]