Skip to main content

All Questions

Tagged with
0 votes
1 answer
47 views

Merge wide and long dataset into wide dataset in R (by combining certain column headers and certain cells into new column headers)

I've 2 datasets Participant performance: 1 participant/row Participant ratings: >1 participants/row (1 rater/row) I need to merge the 2 datasets into 1 dataset with 1 participant/row (including ...
Nick Byrd's user avatar
  • 163
0 votes
1 answer
34 views

Calculate the weighted mean for a variable, which has two types with R

I have the following dataset with the number of times ("n") the variable "V0220" appears in the data by the "id_municipio", but this variable has two types: 1 and 2. ...
Mateus Maciel's user avatar
1 vote
1 answer
112 views

error with cast(reshape), can't find column variable, long to wide

I have used the cast function before with no issues. I am having trouble with this recent dataset. I get this: Error: Can't subset columns that don't exist. x Column `lambs` doesn't exist." It ...
CB55's user avatar
  • 11
4 votes
2 answers
1k views

How to 'reverse melt' a data.frame?

I have data.frame df1 (see code below). I would like to convert it to what df2 looks like (see code below). Maybe this can be done with reshape cast or reverse melt? But I do not understand these ...
Sylvia Rodriguez's user avatar
0 votes
0 answers
24 views

Transforming large dataset from long to wide (450+ value variables) [duplicate]

I have a dataset with 2 columns specifying 'ID' and 3 individual 'Timepoints' that looks like this: ID Timepoint Var1 Var2 Var3 Var4 Var5 1 1 5.7 1.70 4.8 6.8 6.4 1 2 5.7 4....
Jonathon P's user avatar
0 votes
1 answer
610 views

Looking for a way to make my data horizontal in R

I'm currently working in a psychology lab and beginning data analysis on response time data from a task. The task itself goes on multiple trials and this makes the data disorganized to look at - ...
user avatar
1 vote
0 answers
47 views

How to use spread function to get an equivalent result to cast()

I have been informed that the reshape package has not been actively maintained for a long long while; also, i have noticed that the number coming out from the cast() function is not accurate in my ...
mmkuchi's user avatar
  • 11
0 votes
2 answers
116 views

reshape only 2 columns keeping multiple columns same

My sample data looks like: time state district count category 2018-01-01 Telangana Nalgonda 17 Water 2018-01-01 Telangana Nalgonda 8 ...
riyan's user avatar
  • 75
0 votes
0 answers
22 views

Reshape data using melt and cast (reshape / reshape2 in R) [duplicate]

I have the following data. data <- matrix(c(13.54576,"B","B","B","A","B","A","A", 12.48550, "B","A","B","NA","B","B","B", 12.57386, "B","A","B","B","B","NA","A", 12.11360, "B","A","A","B","B","A",...
Sylvia Rodriguez's user avatar
0 votes
1 answer
192 views

Using cast() or ddply() to summarise the mean for two continuous variables in one dataframe

The data (below) has two columns named "Date" and "Independent Variable (IV)" containing factors, plus two extra columns called "Independent_value" and "Sapflow" containing continuous values. ...
Alice Hobbs's user avatar
  • 1,043
0 votes
1 answer
89 views

how to Cast part of the df but still keeping some other columns

What I want to do is create a new column that split task billable and allocate taskHRS to that columns (cast) and allocate the hours into true and false without affecting the other columns. Code that ...
luis vergara's user avatar
0 votes
1 answer
139 views

How to I cast data frame with more than 3 columns in R?

Importing from an Access database, I have data that look similar to this: p <- data.frame(SurvDate = as.Date(c('2018-11-1','2018-11-1','2018-11-1', '2018-11-3',...
KVininska's user avatar
  • 107
1 vote
1 answer
5k views

how to convert string Tensor to Tensor float list?

So, my code is like parsed_line = tf.decode_csv(line, [[0], [0], [""]]) print(parsed_line[0]) del parsed_line[0] del parsed_line[0] features = parsed_line print(parsed_line[0])...
gg1232's user avatar
  • 11
0 votes
1 answer
646 views

R: casting large data frames

I am having issues casting a data frame that is rather large, bumping into memory issues. Alternatively, there is probably a better way to do this. I am open to suggestions on either front to make it ...
kingmidaz's user avatar
0 votes
2 answers
62 views

Create multiple varaibles when using reshape/cast r

I'm working with survey data and have some cases when the respondent has answered the survey multiple times and therefore exists in multiple rows in the data. Like this: Id Question1 1 5 1 3 ...
Calle's user avatar
  • 1

15 30 50 per page