Questions tagged [wide-format-data]
A data frame is in 'wide format' when it spreads a variable across several columns.
wide-format-data
55
questions
0
votes
1
answer
42
views
Dataframe from wide to long output
original wide data frame mean_SRBD:
I have a data frame (mean_SRBD). The measurement moments (day 1, day 2, day 3) are included in the suffix of the variables (-D1 = day 1, -D2 = day 2). I want to go ...
0
votes
0
answers
7
views
How to transform nested data from long format to wide format without using nested structure?
I have a big dataset and have data in long format ('longdf') with one column for subjectnr., one for illness (e.g., rows are epilepsy, ms, diabetes etc.) and other columns for the variables (...
2
votes
3
answers
74
views
Converting dataframe from "wide" to "long" format with pairs of ID variables
Here's an example of what I am trying to do. I am starting with a dataframe in "wide" format, like below.
#sample dataframe
id_1 <- c(260, 500, 640, 720)
id_2 <- c(261, 501, 641, 721)
...
-1
votes
1
answer
46
views
How to convert wide-data to long-data format for big dataset? [closed]
I am conducting a cross-sectional online study about 54 illnesses, and have 10 variables/columns for participants' background information, then participants were randomly assigned to a set of 9 ...
2
votes
1
answer
25
views
How can I collapse repeated missing observations into a single nonmissing observation for the same ID in SAS?
I have a large dataset with hundreds of variables collected over several timepoints. The variables are already defined by timepoint, but each observation is a different timepoint. It's like the ...
0
votes
0
answers
20
views
wide data with part of column name as value [duplicate]
I have the following data structure in R
DE_GDP DE_INFL US_GDP US_INFL
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
...
-1
votes
2
answers
41
views
Pivot a longer dataframe to wide with multiple columns in R
I have a dataframe with 1000+ rows in a long format. I need to pivot into wider format using the ID as the pivoter. Pivoting it using pivot_wider only returns values in the first column, but not all ...
1
vote
2
answers
35
views
R : Reshape Long => wide with different value length
I want to reshape from long to wide the following data base
df_long <- data.frame(
indiv_id = c(rep(1,2), rep(2,6), rep(3,4)),
value = c(sample(x = 2), sample(x = 6), sample(x = 4)),
field_id ...
0
votes
1
answer
98
views
Best way to format this data for exploratory factor analysis, using R? [closed]
I have extremely little experience with factor analysis so my question may beyond rudimentary/remedial. My question is about data formatting. I have this dataset (well, this is just the first two of ...
0
votes
1
answer
156
views
convert SQL output in databricks from long to wide
I have a very simple outcome in databricks that has 80M lines of data because there is a separate line for each PIN. The data is a listing by PIN with columns "pin", "device category&...
0
votes
1
answer
29
views
R: Formatting a weird, long-ish table into wide format
I have some data in the format found in the code chunk.
dat <- data.frame(fruit=c('apple',NA,NA,NA,NA,NA,NA,NA,NA,
'pear',NA,NA,NA,NA,NA,NA,NA,NA,
...
1
vote
1
answer
57
views
Using summarise in wide vs long format
I have a dataframe with the format below. Status has two levels (PRE,POST).
SI_mean
TU_mean
ED_mean
MT_mean
DT_mean
SK_mean
ATT_mean
Status
2.6
2.75
2.6
2.8
3.4
2.5
3.8
PRE
3
3
2.4
2.4
3
3
4
PRE
2....
1
vote
1
answer
51
views
Pandas Even Wider Data
I'm looking to make data even wider than what pd.pivot can provide, and am looking to even change the names of the columns to fit my needs.
I have 3 items with 3 stats that perform differently in 2 ...
2
votes
2
answers
61
views
R: Long to Wide dataframe with concatenation of column values into one
I have a dataframe with the following style.
df = data.frame(Process = rep("Global", 6),
Category = c("Category_1", "Category_1", "Category_2", &...
0
votes
0
answers
14
views
Long to wide data using R
i'm working on machine learning with R.
I want to import a dataset from excel sheet but to be more easy for me to work on it, i would like to transform my date sorted in multiple row for a same ...