Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Importing R cosine similarity to UNIX? Post 302767731 by A-V on Thursday 7th of February 2013 10:35:33 AM
Old 02-07-2013
Importing R cosine similarity to UNIX?

I really need help in this Smilie

I have a file and would like to calculate the cosine similarity of the values in it...

For now I do use R which has an easy function for doing so
Code:
test <- as.matrix(read.csv(file="file.csv", sep=",", header=FALSE)) 
result<- cosine(t(test))

I am using unix of cygwin, so usually have to call
Code:
dos2unix test.sh test.sh

before being able to run a bash file

now I need to combine my R and unix code together
1. either by writing it in unix -- which yet I have not found any way to do
2. Or to call R

1 option is preferable

can you please guide me on this?
thank you very much
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

importing database from unix to winnt

i am a unix-super-beginner (swaddled and weaned on windows) and am trying to import a database from a unix directory into winnt. can someone help me or am i a hopeless case? (4 Replies)
Discussion started by: sadiecutie
4 Replies

2. UNIX for Dummies Questions & Answers

Importing a unix file dump into a PC capable database

My development team has been trying to figure out how to import a unix data dump into SQL Server or convert it into an intermediate file format for several days. The data dump in question looks like this: $RecordID: 1<eof> $Version: 1<eof> Category: 1<eof> Poster: John Doe<eof>... (7 Replies)
Discussion started by: DaltonF
7 Replies

3. UNIX for Advanced & Expert Users

building flat files in unix and importing them from windows

what is a flat file in unix? i have to import a unix flat files from windows based programme. my question is not to export from unix but only to import from windows only. how to build that flat files? how to create export to windows how to import from windows (3 Replies)
Discussion started by: tunirayavarapu
3 Replies

4. Shell Programming and Scripting

awk? create similarity matrix by calculating overlaps between sets comprising of individual parts

Hi everyone I am very new at awk and to me the task I need to get done is very very challenging... Nevertheless, after admiring how fast and elegant issues are being solved here I am sure this is my best chance. I have a 2D data file (input file is a plain tab-delimited text file). The first... (1 Reply)
Discussion started by: stonemonkey
1 Replies

5. Shell Programming and Scripting

Help with merge data based on similarity

Input_file data1 USA 100 ASE data3 UK 20 GWQR data4 Brazil 40 QWE data2 Scotland 60 THWE data5 USA 40 QWERR Reference_file USA 12312 34532 1324 Brazil 23321 231 3421 Scotland 342 34235 UK 231 141 England... (1 Reply)
Discussion started by: patrick87
1 Replies

6. Shell Programming and Scripting

Help with sort list of file based on similarity

Input file (long list of input file): s_1_1_AABCD.txt s_1_1_ABADA.txt s_1_1_DSCBA.txt s_1_1_DSCCA.txt s_1_1_EATTG.txt s_1_1_FADSD.txt s_1_1_TGACC.txt s_1_1_TTAGG.txt s_1_2_AABCD.txt s_1_2_ABADA.txt s_1_2_DSCBA.txt s_1_2_DSCCA.txt s_1_2_EATTG.txt s_1_2_FADSD.txt ... (1 Reply)
Discussion started by: perl_beginner
1 Replies

7. UNIX for Advanced & Expert Users

Vector base Cosine Similarity for two Matrices -- R in UNIX

Dear All, I am facing a problem and I would be Thankful if you can help Hope this is the right place to ask this question I have two matrices of (row=10, col=3) and I want to get the cosine similarity between two lines (vectors) of each file --> the result should be (10,1) of cosine measures I... (10 Replies)
Discussion started by: A-V
10 Replies
fixcos(3alleg4) 						  Allegro manual						   fixcos(3alleg4)

NAME
fixcos - Fixed point cosine of binary angles. Allegro game programming library. SYNOPSIS
#include <allegro.h> fixed fixcos(fixed x); DESCRIPTION
This function finds the cosine of a value using a lookup table. The input value must be a fixed point binary angle. Example: fixed angle; float result; /* Set the binary angle to 45 degrees. */ angle = itofix(32); /* The cosine of 45 degrees is about 0.7071. */ result = fixtof(fixcos(angle)); ASSERT(result > 0.7 && result < 0.71); RETURN VALUE
Returns the cosine of a fixed point binary format angle. The return value will be in radians. SEE ALSO
, ex12bit(3alleg4), ex3buf(3alleg4), exblend(3alleg4), excustom(3alleg4), exspline(3alleg4), exupdate(3alleg4) Allegro version 4.4.2 fixcos(3alleg4)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy