Linked Questions

3 votes
1 answer
3k views

I am using R to transpose a data frame from an excel file (mydata.xls). The original data frame looks like this: ID AB_1 AB_2 AB_3 AB_4 AB_5 Variable1 1 2 3 4 5 Variable2 ...
xuan's user avatar
  • 131
-2 votes
1 answer
313 views

I am looking for a way to reshape the following sample data data <- structure(list(id = c(2L, 5L, 7L), name = structure(1:3, .Label = c("Test1","Test10", "Test8"), class = "factor"), source = ...
nebuloso's user avatar
-3 votes
1 answer
305 views

This dataframe code : f <- function (l) { l } data.frame(lapply(letters[1:2] , f)) which renders : I'm attempting to transpose the rows to cols so a,b appear as : X.a. a X.b. b I tried : f &...
blue-sky's user avatar
  • 54.3k
0 votes
1 answer
319 views

I have an excel with multiple columns (20 in total) with each column containing multiple rows (5000 each). I want to replicate each cell from one row and all the columns 3 times and add them one below ...
Ray's user avatar
  • 86
0 votes
4 answers
67 views

I am trying to run pivot_wider so that the output switches the rows and column fields. This does not accomplish that - what am I missing here? Current: model jan feb mar a 1 2 3 b 2 ...
Dre Day's user avatar
  • 350
0 votes
0 answers
41 views

I did not see anything that completely matches my issue, so I will address it here. In my dataset (lets call it microbes) I am simply trying to switch the rows (BacteriaType) and the columns (SD1-SD4) ...
Erica's user avatar
  • 1
0 votes
1 answer
49 views

Have searched the threads but can't understand a solution that will solve the problem with the data frame that I have. My current data frame (df): # A tibble: 8 x 29 `Athlete` Monday...2 ...
BigBird's user avatar
42 votes
5 answers
74k views

I have a big dataframe, but small example would be like this: mydf <- data.frame(A = c(letters[1:10]), M1 = c(11:20), M2 = c(31:40), M3 = c(41:50)) # A M1 M2 M3 # 1 a 11 31 41 # 2 b 12 32 42 #...
jon's user avatar
  • 11.4k
23 votes
7 answers
67k views

What is the best way to transpose a data.frame in R and to set one of the columns to be the header for the new transposed table? I have coded up a way to do this below. As I am still new to R. I would ...
themartinmcfly's user avatar
6 votes
2 answers
32k views

I am trying to transpose a data frame in R, but having very little luck. The data frame contains an epigenetic data set, with 300,000+ CpG sites in the first column. The 74 additional columns are ...
statsguyz's user avatar
  • 469
0 votes
4 answers
495 views

I want to pivot a data frame My input data is as 1st Input MSFT AAPL GOOG 10 20 40 1st output Id Symbol Value T1 MSFT 10 T1 AAPL 20 T1 GOOG 40 -------------------------...
Chaturvedi Dewashish's user avatar
2 votes
2 answers
5k views

I am using ReporteRs to generate a flexTable using the following piece of code: library( ReporteRs ) baseCellProp <- cellProperties( padding = 2 ) baseParProp <- parProperties(text.align = "...
Ron Jensen's user avatar
1 vote
2 answers
2k views

I have a data set with over 300 columns and rows that looks like this: old= data.frame( id=1:3, DATE=c('20/12/1965','11/101970','03/12/1985'), TRT=c(1,2,1), AT1=c(40,89,50), AT2=c(...
mymymine's user avatar
-1 votes
2 answers
179 views

I am trying to scrape tables from a web page. The web page contains links to data in tables. Basically, I am writing a for loop to get the table from each link and concatenating with the other table. ...
Durga Gaddam's user avatar
3 votes
1 answer
172 views

Original (see Update below) I'm a newbie to R and currently working with collaboration data in the form of an edge list with 32 columns and around 200.000 rows in the following representation: 1 A ...
Seb's user avatar
  • 199

15 30 50 per page