All Questions
10 questions
3
votes
2
answers
54
views
Transposing dataset with repeated / incomplete observations in R
I have the following dataset:
Pt_ID vital_descr vital_value
1 HR 70
1 SBP 110
1 DBP 75
1 HR NA
1 SBP 105
1 DBP 60
2 SBP 150
2 DBP 90
3 HR 55
3 SBP 150
3 DBP 70
3 ...
0
votes
2
answers
66
views
Add column with row values based on a category to R dataframe
so I have a dataframe of the following structure, let's call this one df0:
year
category
a
b
c
d
1989
1
0.3
0.7
0.43
321
1989
1
0.3
0.7
0.43
321
1989
2
0.2
0.4
0.5
174
1989
2
0.2
0.4
0.5
174
1989
2
0....
0
votes
1
answer
58
views
How to transpose columns into rows and ensure repetition of rows accordingly in R? [duplicate]
How to transpose the columns and ensure that rows are repeated accordingly?
Dataset df has the following data :-
Date Year Month Day USD EUR JPY
1994-1-1 1994 1 1 10 20 5
1995-1-1 ...
0
votes
2
answers
113
views
How can I "transpose" the data in this way (see the image)?
I've already asked a similar question last week, but I found out that I need also the ID column and I'm not able to add multiple columns in the code that the person suggested me, so I need to ask it ...
1
vote
2
answers
72
views
How can I "transpose" the data in this way with R studio?
Hi I have a dataframe similar to the one in the photo (left one) and I'm trying to obtain the format on the right one. How can I do it?
example dataset and what I would like to obtain
I know that is a ...
0
votes
0
answers
16
views
Transpose some columns in R [duplicate]
I have a data.frame df1 where I am tracking a monthly score:
Client_ID | Category | January | February
Stack A 0.3 ...
1
vote
2
answers
7k
views
How do I transform a tibble into a matrix?
I'm trying to re-arrange my data. Here's an example to illustrate--I'm hoping that there's an easy way to alter the tibble to form the matrix. The matrix could also be a tibble, though I'd want to add ...
1
vote
2
answers
63
views
restructuring a data frame of co-variances from long to wide
A data frame have contains three variables:
from - character - the name of a measure
to - character - the name of another measure
covariance - numeric - the covariance between the two measures
Here's ...
0
votes
1
answer
828
views
Data transpose function in R not working properly
I am using R to do some work but I'm having difficulties in transposing data.
My data is in rows and the columns are different variables. When using the function phyDat, the author indicates a ...
0
votes
1
answer
56
views
R transposing repeat records
I have a data table that repeats records. I would like to transpose the table but into the unique record names.
Below is a sample of the Data table:
V1 V2 id
ClientID 29 1
CheckID 201 1
...