similar to: Reshaping data from long to wide without a "timevar"

Displaying 20 results from an estimated 300 matches similar to: "Reshaping data from long to wide without a "timevar""

2011 Jul 19
2
read.csv help
Hi, I'm a new R user and I'm having trouble with the read.csv command. It somehow treats the first column as a row name field even though it's not a row name. there are no missing columns/entries and i'm not sure how to resolve this. the format of my data is A, B, C, D,......(3984 columns) 12, 13, 41,......(all numeric) it either treats column A as rownames or if I explicitly
2010 May 05
1
rcorr p-values for pearson's correlation coefficients
Hi! All, To find co-expressed genes from a expression matrix of dimension (9275 X 569), I used rcorr function from library(Hmisc) to calculate pearson correlation coefficient (PCC) and their corresponding p-values. From the correlation matrix (9275 X 9275) and pvalue matrix (9275 X 9275) obtained using rcorr function, I wanted to select those pairs whose PCC's are above 0.8 cut-off and then
2005 Feb 26
1
reshape without timevar argument?
Hi I have a data.frame with 2 columns. The first column is an ID column. The other columns are description of the ids. There is more than one description for each Id. Want I want to get as a value is a data.frame where each row corresponds to one ID and has as many columns as different descriptions. I have used a very convoluted step, but I'm very convinced there is an easier way to do
2011 Jul 04
2
I need help for creating a "timevar"
Hi all! I have data in ?Long? format which I would like to reshape to ?Wide?. I know that one possibility is the ?reshape? command, which needs a ?timevar?. Data look as follows: There are approx. 3000 persons (?IDENTITY?) and, for each person, there are between 2 and 20 events (?EVENT?). For now, there's one row for each event (9506 rows)
2008 Sep 27
2
reshape "Error in data[, timevar] : incorrect number of dimensions"
I have two waves of a survey given to students at various middle schools and high schools, with student id numbers for each student. I am having difficulty reshaping the file from long to wide. My code is below: library(foreign) svy <- read.spss("studsur4.SAV") svy.wide <- reshape(svy, timevar="WAVE", idvar="id", direction="wide")
2007 Nov 16
2
expand.grid overflows?
>cbn<-as.matrix(expand.grid( rep( list(0:1), 50))) Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value In addition: Warning message: In rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : NAs introduced by coercion But I'm only interested in cbn matrix rows where: cbn<- cbn[rowSums(cbn)==5,] Is there a way to evaluate it
2005 May 05
6
Need some quick help with lattice - barchart
For the following code below, the x-axis ticks are 1,2,3,4,5,6,7 when I was expection them to be 1,2,8,9,10,11,12. Please help me figure out where is the mistake. library(lattice) testdata <- as.data.frame(t(structure(c( 1,2005,9.24,6.18,634, 2,2005,8.65,6.05,96, 8,2004,6.81,6.51,16, 9,2004,9.0,7.29,8, 10,2004,8.84,6.18,524, 11,2004,8.54,6.35,579, 12,2004,9.97,6.3,614, 12,2005,8.75,5.84,32,
2015 Aug 05
1
Samba4 not able to write to group writeable folder???
Hi... With samba4 I sometimes feel like a bloody beginner even I use samba since ages. Miracle of the day: Users connecting using samba4 cannot write to group writeable folders even they should be able to. I upgraded one 3.6 fileserver to 4.2.3. PDC is always a samba 4.2.3 instance. I am using samba4 in classic PDC mode for a couple of reasons. On my fileserver I have a folder called
2005 Apr 21
3
Need help with R date handling and barchart with errorbars
Hi All.. Have a question.. For the following r code testdata <- as.data.frame(t(structure(c( "1/1/04","LV1",3.8,2,87, "2/1/04","LV1",3.2,3,28, "3/1/04","LV1",3.4,3,88, "4/1/04","LV1",3,2,26, "5/1/04","LV1",3.8,2,87, "6/1/04","LV1",3.2,3,28,
2007 May 13
2
extracting text contained in brackets ("[ ... ]") from a character string?
I have a text string that contains text within two brackets. e.g. "testdata[3]" "testdata[-4]", "testdata[-4g]", I wish to "extract" the string enclosed in brackets? What is a good way to do this? e.g. fun(testdata[3]) = '3' fun(testdata[-4g]) = '-4g' --------------------------------- Moody friends. Drama queens. Your life?
2003 Sep 23
2
confusion about what to expect?
In playing around with data.frames (and wanting a simple, cheap way to use the variable and case names in plots; but I've solved that with some hacks, yech), I noticed the following behavior with subsetting. testdata <- data.frame(matrix(1:20,nrow=4,ncol=5)) names(testdata) ## expect labels, get them names(testdata[2,]) ## expect labels, get them names(testdata[,2]) ## expect labels, but
2009 Mar 06
2
Interaction term not significant when using glm???
Dear all, I have a dataset where the interaction is more than obvious, but I was asked to give a p-value, so I ran a logistic regression using glm. Very funny, in the outcome the interaction term is NOT significant, although that's completely counterintuitive. There are 3 variables : spot (binary response), constr (gene construct) and vernalized (growth conditions). Only for the FLC construct
2010 Feb 12
2
Access dataframe with variable name in function
Sorry guys, but I have another one: I want to write a function that returns a certain column of a dataframe. The function accepts two argument: the dataframe and the name of the column, but the column is not given as a "string" but as a variable name. EXAMPLE ---------------------- > testdata start stop censor groupvar var1 var2 1 0 1 0 1
2012 Mar 30
3
Adding text for written comments to bottom of graphs
Hello All, Recently developed the code below for graphing patterns of chemotherapy administration. As someone just starting to use R in their work, I managed to figure out some parts of the code but needed help with others. setwd("N:/Regimen Coding/0906/Plots Test") getwd() TestData <- structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3), line = c(1, 1,
2005 Feb 16
2
problem with se.contrast()
I am having trouble getting standard errors for contrasts using se.contrast() in what appears to be a simple case to me. The following test example illustrates my problem: Lab <- factor(rep(c("1","2","3"),each=12)) Material <- factor(rep(c("A","B","C","D"),each=3,times=3)) Measurement <-
2010 Aug 13
1
Bug in t.test?
Hello all, due to unexplained differences between statistical results from collaborators and our lab that arose in the same large proteomics dataset we reevaluated the t.test() function. Here, we found a weird behaviour that is also reproducible in the following small test dataset: Suppose, we have two vectors with numbers and some missing values that refer to the same individuals and that
2005 Apr 22
1
Need help arranging the plot in different fashion than the default format
I want to change the way the plot is appearing in the barchart .. testdata <-
2007 Jul 25
3
Constructing bar charts with standard error bars
I am new to R. I want to graph group data using a "Traditional Bar Chart with Standard Error Bar", like the kind shown here: http://samiam.colorado.edu/~mcclella/ftep/twoGroups/twoGroupGraphs.html Is there a simple way to do this? So far, I have only figured out how to plot the bars using barplot. testdata <- scan(, list(group=0,xbar=0,se=0)) 400 0.36038 0.02154 200 0.35927
2009 Aug 17
3
Replacing NA values in one column of a data.frame
Dear all, I'm trying to replace NA values with -9999 in one column of a data frame. I've tried using is.na and the testdata[testdata$onecolumn==NA] <- 9999 approach, but whilst neither generate errors, neither result in -9999s appearing - the NAs remain there! I'd be grateful for any advice on what I'm doing wrong or any other suitable approaches. Many thanks, Steve
2018 Apr 24
2
AIX make checks issue
On 23/04/2018 11:49, Michael Felt wrote: > On 21/04/2018 16:21, Michael Felt wrote: > > > Question: I have not dug into the tests yet. Will copy to a "local" > directory, and not build out of tree and see if that fixes it (as it > does for many other packages). However, just in case it does not - how > can I fast-forward the tests to the "agent" tests?