Questions tagged [spread]

This tag relates to the R spread function. For the javascript spread syntax - please use spread-syntax.

Some of the features are:

  1. Powerful Formula Engine with 300+ Excel Functions
  2. Full Excel Import/Export, PDF, and Print
  3. Support Input, Display, and Data Visualization Controls
  4. Visual Drag-and-Drop Designers
420 questions
-1
votes
1 answer

Converting column entries to column headers with count of entries

I have a dataset of two columns by 13893 rows as follows: trip species 120318 ADHJ 120918 FJIW 120918 ADHJ 180817 ADHJ 180817 FJIW 180817 FJIW 099217 ADHJ I want to change it so that the species names become column headers and the count…
DND
  • 113
  • 2
  • 7
-1
votes
1 answer

All my columns are in row format. How can i change the dataframe to have each row made into a column, based on each Team ID

I'm trying to clean some data for some soccer analysis I wanted to do. My problem is that I can't figure out how to properly change my dataframe. Without a picture, there's really nothing I can do to properly explain it. Here's a screenshot of my…
-1
votes
1 answer

Separate value in field by character, create multiple columns to the right based on the number of splits possible

I've asked a series of questions. Separate contents of field Separate variable in field by character. Which I think contained multiple questions around the same topic. I've had excellent answers on how to use separate_rows and then a great answer…
damo
  • 463
  • 4
  • 14
-1
votes
1 answer

Converting to wide format from long with multiple id and value columns

I am stuck trying to convert from wide to long format with multiple ID and value columns. I'd prefer a tidyr solution as dcast as been defaulting to length. Here's what I've tried so far: df_wide <- df %>% melt(id.vars = c(Route, Address, Week))…
philiporlando
  • 941
  • 4
  • 19
  • 31
-1
votes
1 answer

Cluster calculation tutorial - issue with spread

While following this very interesting tutorial (https://rpubs.com/hrbrmstr/customer-segmentation-r), i came across an error i dont really understand. Here is the piece of code resulting in the message 'Error: Value column 'n' does not exist in…
Romain
  • 171
  • 11
-1
votes
2 answers

R Data Manipulation, convert flat table to structure table

my goal is to convert a data.frame of the form: ID 1 ID 2 Value 5 k 7 5 k 2 5 l 4 6 b 2 into a table of the form: ID 1 k l b 5 7 4 6 2 I would…
Walde
  • 45
  • 8
-1
votes
1 answer

pivot pairs of key-value variables using tidyr:spread()

I am trying to pivot pairs of key-value variables using tidyr:spread() . id <- c(0,1,2,3,4,5,6,7,8,9) key1 <- c("a", "a", "b", "b", "c","a", "a", "b", "b", "c") val1 <- c(1,2,3,1,2,3,1,2,3,1) key2 <- c("d",NA,NA,NA,"e","d","d",NA,"b",NA) val2 <-…
ronencozen
  • 1,991
  • 1
  • 15
  • 26
-1
votes
1 answer

How spread out the result from JSON an array for later use as a data title, text, images, etc

import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let url = NSURL(string: "http://www.kinodrive.com/some_test/jsontest.php") var request = NSURLRequest(URL:…
-2
votes
2 answers

Is there a spread operator for golang structs

Have the following structs where PostInput is a param for a createPost function. type PostInput struct { Title String Content String } type PostInputWithTime struct { Title String Content String CreatedAt Time UpdatedAt Time } But do not…
gsmig
  • 80
  • 2
  • 10
-2
votes
2 answers

How to spread Objects inside Array in JavaScript

I have this array [ {FirstName: 'Emeka'}, {MiddleName: 'Praise'}, {LastName: 'Orji'}, {Date: 'Today'}, {Month: 'July'}, {Year: '2022'}, {Gender: 'Female'}, {MaritalStatus: 'married'}, {State: 'Lagos'}, {Origin: 'Ape'}, ] I want…
Emeka Orji
  • 174
  • 4
  • 11
-2
votes
3 answers

What is this demonstrating the spread syntax can do?

Looking at this MDN page on spread syntax it uses this example: function myFunction(v, w, x, y, z) { console.log(v); console.log(w); console.log(x); console.log(y); console.log(z); } const args = [0, 1]; myFunction(-1, ...args, 2,…
-2
votes
1 answer

pass other column inside spread with duplicate identifiers

I have the below dataframe where I am trying to spread the feature_code by passing the actv_amt so that I get the corresponding actv_amt for the corresponding feature code. I am trying to pass as count_FEATURE = ACTV_AMT it is passing the value but…
vinay karagod
  • 256
  • 1
  • 3
  • 18
-3
votes
1 answer

Spreading one column to Multiple columns in R (Spread?, Reshape?)

I want to get rid of the Station.ID column in the table below by distributing (Spread?, Reshape?) it to the month columns so that I get columns such as Jan_323, Feb_323, ... , Jan_452, Feb_452, ... Have: Station.ID Year Jan Feb Mar …
-5
votes
1 answer

what is difference between prevUsers = [...users] & prevUsers = users javascript?

i use this code snippet to make a copy of my user array : var prevUsers = [...users]; but using "var prevUsers = users;" not working as well, and i want to know what is difference between these syntaxes ?? i checked prevUsers = [...users] &…
Amin Zekri
  • 21
  • 2
1 2 3
27
28