All Questions
56 questions
0
votes
0
answers
82
views
In R, when transpose data from row to column, why spread() code doesn't work?
I have a data below
dataA= data.frame(
Location = rep(c("East", "West", "North"), each = 12 * 2),
Season = rep(rep(c(2021, 2022), each = 6), 3),
Genotype = rep(rep(...
1
vote
2
answers
55
views
In R, how to transpose row data to coulmn per variable? [duplicate]
I have some data like below
dataA=data.frame(structure(list(Season = c(2021, 2021, 2021, 2021, 2021, 2022,
2022, 2022, 2022, 2022, 2023, 2023, 2023, 2023, 2023),
...
0
votes
1
answer
39
views
R transform data wid while keeping date format - reshape or dcast
Trying to do something so simple and transpose this data wide so for each ID I have the VisitNum {1,2,3} as the column header and the CollectionDate as the value.
At my starting point Collection date ...
0
votes
1
answer
22
views
Transpose dataframe without timevar and with multiple id variables
I have a question similar to a prior post.
Transpose / reshape dataframe without "timevar" from long to wide format
I am trying to transpose a dataset fromn long to wide format. I am ...
1
vote
1
answer
44
views
The recast fun to spread the rows is omitting key columns in R?
I am trying to spread my data such that months are the columns associated with both site and spx. I tried to use recast but I lose the informaton about species. What do I do to get the expected output ...
2
votes
4
answers
771
views
R dplyr pivot wider with duplicates and generate variable names [duplicate]
How can I go from
df<-data.frame(id=c("A", "B", "B"), res=c("one", "two", "three"))
df
to
df.output<-data.frame(id=c("A", &...
2
votes
3
answers
858
views
How to transpose times series data in R so that the date-variable ends up as the new variables names
I have a huge times series dataset (over 500 variables) consisting of monthly observations for several years. See a simplified example of the input data below (in Excel):
Now, what I need to do (in R)...
0
votes
3
answers
304
views
transpose data in one column based on unique values in another column [duplicate]
I basically would like to do what is described here in r
example data
names<-c("k127_60234", "k127_60234","k127_60234","k127_60234","k127_50234",&...
0
votes
2
answers
111
views
Reshape dataframe in R, different dates
I have data that looks like this:
ID
Name
Role
Status
Date
1
John
GM
Current
12.04.2021
1
Ann
GM
Previous
10.07.2020
1
Mary
GM
Previous
24.01.2017
2
Ann
GM
Current
12.04.2021
2
Josef
GM
Previous
02.07....
0
votes
1
answer
408
views
Reshape/Transpose duplicated rows to column in R studio
I have data that looks like this:
ID
Name
Adress
Score
Requirement
Status
1
John
CA
1
Internet
OK
1
John
CA
1
TV
Not OK
1
John
CA
1
Household
OK
2
Ann
LA
3
Internet
Not OK
2
Ann
LA
3
TV
Follow up
...
....
2
votes
3
answers
260
views
Reshape dataframe without “timevar” and multiple value columns from long to wide format
I stumble over the problem that I want to convert two columns into one line, and I do this with a key. I have a table which consists of the keys, activities and the corresponding intervals of the ...
0
votes
1
answer
54
views
How to split column names and drop parts of the names and convert data from wide to long format in R
I have data in the following format:
dataset <- data.frame(taxa = c("k__Archaea| p__Crenarchaeota", "k__Archaea| p__Euryarchaeota", "k__Bacteria| p__[Thermi]"),
...
0
votes
0
answers
62
views
complex transposing using Reshape function from Wide to Long
i would like to re shape merged file , below it the input table.
library(readr)
df2 <- read_table2("February February February February February February February February ...
0
votes
3
answers
131
views
R transposing date frame and set column headers [duplicate]
I have a data frame that i want to transpose (i suppose transpose is the correct word).
The code below will give a simplified Data frame.
tests <- c("TestA", "TestB", "...
1
vote
2
answers
48
views
R studio: How to transform columns to multiple rows as factos [duplicate]
I'm currently working with RStudio and I'm having some problems. I've researched some functions (reshape,merge, combine, etc.) but couldn't get my problem solved.
I have this kind of data in excel:
...