3 added 167 characters in body
source | link

R, 29 2323 21 bytes

As noted by MarcoBreitig, we can shorten it to 21 bytes if we don't need to provide it as a function:

x=scan();x[order(!x)]

Previous versions:

function(x)x[order(!x)]

The function takes a vector as input and orders by the logical vector that results from negating the input.


 

Original answer:

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

R, 29 23 bytes

function(x)x[order(!x)]

The function takes a vector as input and orders by the logical vector that results from negating the input.


 

Original answer:

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

R, 29 23 21 bytes

As noted by MarcoBreitig, we can shorten it to 21 bytes if we don't need to provide it as a function:

x=scan();x[order(!x)]

Previous versions:

function(x)x[order(!x)]

The function takes a vector as input and orders by the logical vector that results from negating the input.

Original answer:

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

2 added 178 characters in body
source | link

R, 2929 23 bytes

function(x)x[order(!x)]

The function takes a vector as input and orders by the logical vector that results from negating the input.


Original answer:

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

R, 29 bytes

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

R, 29 23 bytes

function(x)x[order(!x)]

The function takes a vector as input and orders by the logical vector that results from negating the input.


Original answer:

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.

1
source | link

R, 29 bytes

function(x)c(x[x!=0],x[x==0])

The function takes a vector as input and the concatenates (c()) the non-zero values and then the zero-values.