All Questions

534
votes
16answers
288680 views

Access / process (nested) objects, arrays or JSON

I have a (nested) data structure containing objects and arrays. How can I extract the information, i.e. access a specific or multiple values (or keys)? For example: var data = { code: 42, it...
61
votes
18answers
283121 views

How do I remove objects from an array in Java?

Given an array of n Objects, let's say it is an array of strings, and it has the following values: foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd"; What do I have to do to delete/remove al...
42
votes
6answers
21557 views

Split delimited strings in a column and insert as new rows

I have a data frame as follow: +-----+-------+ | V1 | V2 | +-----+-------+ | 1 | a,b,c | | 2 | a,c | | 3 | b,d | | 4 | e,f | | . | . | +-----+-------+ Each of the alphabet i...
3
votes
1answers
16603 views

jQuery jqGrid Show message when an edit row is complete

I am following this tutorial here http://www.trirand.com/blog/jqgrid/jqgrid.html in LiveDataManipulation->EditRow My grid receive data from script a.php. After the user can modify this data by the jq...
37
votes
7answers
29634 views

Read a CSV from github into R

I am trying to read a CSV from github into R: latent.growth.data <- read.csv("https://github.com/aronlindberg/latent_growth_classes/blob/master/LGC_data.csv") However, this gives me: Error in f...
11
votes
3answers
86430 views

Converting String Array to an Integer Array

so basically user enters a sequence from an scanner input. 12, 3, 4, etc. It can be of any length long and it has to be integers. I want to convert the string input to an integer array. so int[0] woul...
2
votes
3answers
7186 views

Finding maximum value of one column (by group) and inserting value into another data frame in R

All, I was hoping someone could find a solution to an issue of mine that isn't necessarily causing headaches, but, as of right now, invites the possibility for human error in creating a data set for ...
3
votes
2answers
2328 views

Create a variable capturing the most frequent occurence by group

Define: df1 <-data.frame( id=c(rep(1,3),rep(2,3)), v1=as.character(c("a","b","b",rep("c",3))) ) s.t. > df1 id v1 1 1 a 2 1 b 3 1 b 4 2 c 5 2 c 6 2 c I want to create a third ...
13
votes
1answers
2072 views

Sliding time intervals for time series data in R

I am trying to extract interesting statistics for an irregular time series data set, but coming up short on finding the right tools for the job. The tools for manipulating regularly sampled time seri...
20
votes
2answers
34593 views

remove row with nan value

let's say, for example, i have this data: data <- c(1,2,3,4,5,6,NaN,5,9,NaN,23,9) attr(data,"dim") <- c(6,2) data [,1] [,2] [1,] 1 NaN [2,] 2 5 [3,] 3 9 [4,] 4 NaN [5,...

Previous Next