Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: quincyjones
1,432
Posted By quincyjones
No worries but thank you for the help. I figure...
No worries but thank you for the help. I figure out this in R in more easy way.

library(dplyr)
a<-read.table("input", head=T)
b<- a %>%
group_by(name) %>%
summarise_each(funs(median(.,...
1,432
Posted By quincyjones
I am afraid, it seems there is a small bug some...
I am afraid, it seems there is a small bug some where. Sometimes, I get different outputs from the same input. Some times just the header.
1,432
Posted By quincyjones
How to print median values of matrix -awk?
I use the following script to print the sum and how could I extend this to print medians instead? thanks

name s1 s2 s3 s4
g1 2 8 6 5
g1 5 7 9 9
g1 6 7 8 9
g2 8 8 8 8
g2 7 7 7 7...
963
Posted By quincyjones
yeah, sorry. done! 'e' is a single letter...
yeah, sorry. done!
'e' is a single letter group. 'c' is not a single letter group. because there is a group that shares c in it, 'cd'.
963
Posted By quincyjones
@RudiC: First part is correct. Second part noy...
@RudiC: First part is correct. Second part noy exactly. If you do Venn diagram with the letters in the groups of a specific set, you should always see 'a' as a separate group. For example, j007 has...
963
Posted By quincyjones
Yes that's correct. I forgot to include j009 in...
Yes that's correct. I forgot to include j009 in the output earlier. My apologies.
963
Posted By quincyjones
Thanks. But the group has to be always unique....
Thanks. But the group has to be always unique. Sorry maybe I didn't explain well. For example, first, the group with highest score 'a' should be unique. Means no ab or abc etc. Therefore j008 is not...
963
Posted By quincyjones
HHow to print the group with a highest value within a set
How to print the names with a highest value within a set and filter if it is the only unique group within the same set

input

sets names value groups
j007 shot1 0.6 a
j007 ...
1,399
Posted By quincyjones
sorry my bad. it is working fine.
sorry my bad. it is working fine.
1,399
Posted By quincyjones
I have 12k columns and 200k rows. I am running...
I have 12k columns and 200k rows. I am running this script using 60GB memory but it was failing. Is it it possible to run this more memory efficient? thanks @RavinderSingh13
1,399
Posted By quincyjones
updated. The file should be tab delimited.
updated. The file should be tab delimited.
1,399
Posted By quincyjones
I was using this that prints everything in one...
I was using this that prints everything in one column

awk '{ for (i=1;i<=NF;i+=2) print $i }'
1,399
Posted By quincyjones
How print evencolumns using awk ?
I have a big file (with 200k rows and 10k columns).
How can I print all even columns of this file and also keep the first column?

input
a 1 a 10 a 11 a 12
b 2 b ...
2,164
Posted By quincyjones
How to append the output in a new column?
input1
john 20
bob 30

input2
john 60
bob 100

cat input1 >> output
cat input2 >> output

ouput
john 20
bob 30
john 60
bob 100

desired output
input1 input1 input2 input2
john 20...
757
Posted By quincyjones
Print the output with different file names
I have a python script that gives output called test.png. By using the following command I run the script every 2 seconds. What is the easiest way to save the output as follows ( test.png (1st...
1,331
Posted By quincyjones
Transform columns to matrix
The following code transform the matrix to columns. Is it possible to do it other way around ( get the input from the output) ?

input

y1 y2 y3 y4 y5
x1 0.3 0.5 2.3 3.1 5.1
x2 1.2 4.1...
1,140
Posted By quincyjones
it works great. thanks. note:you forgot this...
it works great. thanks.
note:you forgot this at end of the script. }'
1,140
Posted By quincyjones
How to shuffle odd and even columns?
Is there any way to place each even column name infront of its odd column using awk or others?

input

Ab name MGH26 B04 MGH26 B05

output

name_Ab B04_MGH26 B05_MGH26
1,613
Posted By quincyjones
sorry. I updated the question. Please let me know...
sorry. I updated the question. Please let me know if it is still confusing.
1,613
Posted By quincyjones
How to sum the matrix using awk?
input
A1 B1 A2 B2
0 0 1 1
1 0 0 1
0 1 1 0
1 1 1 1

Output
label A1 B1 A2 B2
A1 2 1 1 2
B1 1 2 2 1
A2 1 2 3 2
B2 2 1 2 3

Ex:
The number of times that A1 and B1 row values are both 1...
926
Posted By quincyjones
yes almost. more detailed example for...
yes almost. more detailed example for clarification.

input
amex-11 10 abc
amex-11 20 bcn
amed-12 1 abc
amex-12 10 abc
amex-12 20 bcn
amed-13 1 abc

ouput shouldbe

amex-11 1 10 abc...
926
Posted By quincyjones
Count occurrences in first column
input

amex-11 10 abc
amex-11 20 bcn
amed-12 1 abc

I tried something like this.

awk '{h[$1]++}; END { for(k in h) print k, h[k] }' rm1

output
amex-11 1 10 abc
amex-11 1 20 bcn...
1,513
Posted By quincyjones
Thanks but I tried this and didn't work tr...
Thanks but I tried this and didn't work

tr -d '\r' <$1 | awk ' {LN[$1]; HD[$2]; MX[$1,$2]++}
END { printf "%10s", ""; for (i in HD) printf "%10s", i; print...
1,513
Posted By quincyjones
you are right. however it was based on 3 columns...
you are right. however it was based on 3 columns and here it is just two.
I noticed that if the column names are longer for example instead of c1 c1_abajgdhd_1234x, the script is printing bit...
1,513
Posted By quincyjones
How to convert 2 columns into matrix -awk?
How can i convert two columns in to o and 1 matrix. thnks

Input
a c1
b c2
c c1
d c3
e c4

output
c1 c2 c3 c4
a 1 0 0...
Showing results 1 to 25 of 184

 

Featured Tech Videos

All times are GMT -4. The time now is 05:27 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy