similar to: Adding columns to a grouped data frame

Displaying 20 results from an estimated 60000 matches similar to: "Adding columns to a grouped data frame"

2008 Apr 07
2
Naming rows oe columns in a data frame.
Hello there! I have a really basic question. I have extracted some data from a big database. I have ordered the data in to different agegroups in the rows. Now I want to to have labels of the columns which is going to be divided into men , women and totals. How do I give names to a column? My data looks like this for the moment; 0-39 12 34 43 40-49 14 23 23 50-59 16
2009 Sep 15
4
Reading a data frame from R to excel
Hello! I've generated multiple data frames that I wish to export to excel using the function write.table. When I do so all the data is merged into a single column in excel. I Would like the columns of my data frame in separate columns in excel as well but it doesn't work. I tried to download the package WriteXLS and installed Perl on my computer just like it was recommended. I also tried
2011 Aug 31
2
Treat an Unquoted Character String as a Data Frame
I have several datasets that come from different studies (fv02 and fv03), they represent different levels (patients and lesions), and they have different patient populations (itt, mitt, mitt3). I wanted to write some code that would pass my three requirements into a function I wrote, produce the output, but not have to require me to also pass a unique plot title or output filename for each
2006 Jul 31
0
Three questions about a model for possibly periodic data with varying amplitude
Hi dear R community, I have up to 12 measures of a protein for each of 6 patients, taken every two or three days. The pattern of the protein looks periodic, but the height of the peaks is highly variable. It's something like this: patient <- data.frame( day = c(1, 3, 5, 8, 10, 12, 15, 17, 19, 22, 24, 26), protein = c(5, 3, 10, 7, 2, 8, 25, 12, 7, 20, 10, 5) ) plot(patient$day,
2012 Nov 26
1
A problem subsetting a data frame
Hi all, I have this microarray large microarray data set (ALL) from which I would like to subset or extract a set of data based on a factor ($mol.biol). I looked up some example of subsetting in, picked up two commands and tried both but I got error messages as follows > testset <- subset(ALL, ALL$mol.biol %in% c("BCR/ABL","ALL1/AF4")) >> Error in
2008 Sep 26
3
Newbie: Ranking a data frame, grouped by 2 or more columns
Hi, I'd like to rank obs in a data frame as subset by 2 or more columns... The example input would look like the following: ====+====+====+====+ x y v -- -- -- a w 200 a w 100 b w 500 b w 200 b z 300 b z 400 ====+====+====+====+ And the data frame I want to create is below: ====+====+====+====+ x y v rank -- -- -- ---- a w 200 1 a w 100 2
2008 Apr 27
1
Adding rownames with different lengths to a table
Hello! I would like to add names to a table. The table presents median values, numbers of values (n) and percentage(%) for a given agegroup. Thus I would like to add a label above these three variables for each category. But if I try to use colnames I get a message telling me that the number of labels must be equal to the number of columns in the table. I hope someone could understand what I mean!
2011 Oct 30
1
Normality tests on groups of rows in a data frame, grouped based on content in other columns
Dear R users, I have a data frame in the form below, on which I would like to make normality tests on the values in the ExpressionLevel column. > head(df) ID Plant Tissue Gene ExpressionLevel 1 1 p1 t1 g1 366.53 2 2 p1 t1 g2 0.57 3 3 p1 t1 g3 11.81 4 4 p1 t2 g1 498.43 5 5 p1 t2 g2 2.14 6 6 p1 t2 g3 7.85 I
2006 Aug 17
1
How to sort child table on fields in the associated parent
For an Xray file system patients have folders and folders have studies. That is: patients folders studies id id id name patient_id folder_id ... label type ... ... The list of studies with their associated folder and patient might look like this: name folder_label study_type
2007 Mar 27
1
basic handling of data.frame
Hello, I'm new to R but wan't to use it to compute the statistics of my medical study. The study includes several parameters for a number of patients. Each parameter was assessed by a number of readers, once with a special condition, once without. Now I have a data.frame with colums like: PatientID, ReaderID, SpecialCond(yes/no), Parameter1, Parameter2..... the rows are not sorted, and
2006 Jul 31
1
Random Effects Model with Interacting Covariates
Hi I have been asked by a colleague to perform a statistical analysis which uses random effects - but I am struggling to get this to work with nlme in R. Help would be very much appreciated! Essentially, the data consists of: 10 patients. Each patient has been given three different treatments (on three separate days). 15 measurements (continuous variable) have been taken from each patient
2011 Dec 07
2
plotting and coloring longitudinal data with three time points (ggplot2)
Dear list, I have been struggling with this for some time now, and for the last hour I have been struggling to make a working example for the list. I hope someone out there have some experience with plotting longitudinal data that they will share. My data is some patient data with three different time stamps. First the patients are identified at different times (first time stamp). Second, they
2012 Jul 18
3
Subsetting problem data
Hello, I need to subset my data to only look at the parts that have "holes" in it. I already have a formula to get rid of inconsistencies, but now I need to look only at the problem data to reconfigure it. In my data set where there are multiple "cycles" per "patient," and I want to highlight the patients who have a variable was not measured every cycle. Here's a
2012 Feb 10
2
apply pairs function to multiple columns in a data frame
I am very new to R and programming and thank you in advance for your patience and help with a complete novice! I am working with a large multivariate data set that has 10 explanatory environmental variables (e.g. temp, depth) and over 60 response variables (each is a separate species). My data frame is set up like the simplified version below: JulianDay Temperature Salinity Depth Copepod
2011 May 01
1
Longitudinal data with non-randomized subjects
Dear List, I have a theoretical question related to epidemiological data analysis: If the treatment status (tx = 0,1) changes over time for the patients in a non-randomized cohort, is there a way to estimate the treatment effect? (i.e., after joining the study, some patients may have to wait for a period of time before receiving the treatment, i.e., the situation of patient with id == 2 for the
2024 Apr 18
1
Tidyverse/dplyr solution for filling values of a tibble/dataframe from a column with a nested list.
Hi experts. I have a tibble? with a column containing a nested list (<list<list<double>>>? data type to be specific). Looks something like the following (but in R/Arrow? format): ID Nestedvals 001 [[1]](1,0.1)[[2]](2,0.2)[[3]](3,0.3)[[4]](4,0.4)[[5]](5,0.5) 002 [[1]](1,0.1)[[2]](2,0.2)[[3]](3,0.3)[[4]](4,0.4) 003 [[1]](1,0.1)[[2]](2,0.2)[[3]](3,0.3) 004 [[1]](1,0.1)[[2]](2,0.2)
2009 Aug 26
1
Within factor & random factor
Hi, I am quite new to R and trying to analyze the following data. I have 28 controls and 25 patients. I measured X values of 4 different locations (A,B,C,D) in the brain image of each subject. And X ranges from 0 to 1. I think "control or patient" is a between subject factor and location is a within subject factor. So, controls: 28 patients: 25 (unbalanced data set) respone measure:
2012 Jul 19
2
Subsetting problem data, 2
Hello, I didn't give enough information when I sent an query before, so I'm trying again with a more detailed explanation: In this data set, each patient has a different number of measured variables (they represent tumors, so some people had 2 tumors, some had 5, etc). The problem I have is that often in later cycles for a patient, tumors that were originally measured are now missing (or
2007 Jun 20
2
"xtable" results doesn't correspond to data.frame
Dear useRs, Am trying to use xtable on the following data.frame and I don't get what I expect: example.table <- data.frame(rbind( c("Gender"," "," "," "), cbind(rep(" ",2),c("Male","Female"),c(3.0,4.0),c(3/7,4/7)) )) colnames(example.table) <- c(" "," ","number of
2010 Nov 08
0
How to represent factor levels & ordiellipses using different colors?
Dear Jari Oksanen, I am Trinadh Kumar, a student of Biotechnology from Texas Tech University. I have a question for you regarding constrained ordination graphs. I had previously plotted constrained ordination graphs using distance based redundancy analysis for species data on patients. The species matrix consists of 70 patients and 274 species of bacteria.The metadata matrix consists of 10