dataframe
Loop over rows of dataframe applying function with if-statement
I\'m new to R and I\'m trying to sum 2 columns of开发者_如何学JAVA a given dataframe, if both the elements to be summed satisfy a given condition. To make things clear, what I want to do is:[详细]
2023-03-15 23:17 分类:问答Converting an ftable (contingency table) to a dataframe in R
I am generating an ftable (by running ftable on the results of a xtabs command) and I am getting the following.[详细]
2023-03-15 14:24 分类:问答R plot frequency of strings with specific pattern
Given a data frame with a column that contains strings. I would like to plot the frequency of strings that bear a certain pattern. For example[详细]
2023-03-15 07:10 分类:问答model.matrix generates fewer rows than original data.frame
Why doesn\'t a model matrix necessarily have the same number of rows as the data frame? mergem = model.matrix(as.formula(paste(response, \'~ .\')), data=mer开发者_如何学运维gef)[详细]
2023-03-14 15:41 分类:问答Override [.data.frame to drop unused factor levels by default
The issue of dropping unused factor levels when subsetting has come up before. Common solutions include using character vectors where possible by declaring[详细]
2023-03-14 02:10 分类:问答making a complex yaml from R
I am trying to make yaml format file from R. I know there is a package for such a 开发者_StackOverflow社区job, but its example is so simple and my object is a bit more tricky !![详细]
2023-03-13 18:26 分类:问答R: combine lists of interest
I have a list like df_all (see below). A = matrix( ce开发者_Python百科iling(10*runif(8)), nrow=4)[详细]
2023-03-13 10:32 分类:问答Reshape data from long to semi-wide in R
I have data in which each participant made 3 judgments on each of 9 objects (27 judgments).The 9 objects varied in a 3x3 design (within subjects) so there are 2 factors.[详细]
2023-03-12 08:36 分类:问答R: how to read in a series of txt files to R as csv but firstly delete the first three lines of the txt files
I have a series of txt files. I have all these filenames in a csv file X in the Column V1 (X$V1), e.g. a.txt, b.txt....[详细]
2023-03-11 23:31 分类:问答Remove an entire column from a data.frame in R
Does anyone know how to remove an entire column from a data.frame in R? For example if I am given this开发者_如何学Python data.frame:[详细]
2023-03-11 19:37 分类:问答