turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Append Data to End of Array

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 17, 2017 3:14 PM
(406 views)

I am having issues appending data to the end of an array. I have been using the concatenate operator (||), but then the result is a matrix which messes up the calculations I am working on. Is there an easy way to do this?

Example:

```
// Sample data set
data1 = [1, 2, 3, 4, 5];
data2 = [6, 7, 8, 9, 10];
result = data1 || data2;
/* output of result:
[1 6,
2 7,
3 8,
4 9,
5 10] */
// desired result: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
```

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 17, 2017 5:05 PM
(765 views)

Solution

Change your concatenation to:

`result = data1 |/ data2;`

BTW....in JSL terms, you do not have an "Array", you have a "Matrix"

Jim

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 17, 2017 4:01 PM
(404 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 17, 2017 5:05 PM
(766 views)

Change your concatenation to:

`result = data1 |/ data2;`

BTW....in JSL terms, you do not have an "Array", you have a "Matrix"

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 18, 2017 8:37 AM
(371 views)