|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Importing R cosine similarity to UNIX?
I really need help in this ![]() 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 |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
I think you will have to give more details in order to get some help:
What OS are you on? explain the R code, and what you want in unix Where does cygwin intervene in the process etc... |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
I have two files each of 6 lines each representing the frequency of specific words now I wanted to calculate the cosine similarity between these files for R I simply combine both files and extracted the bits from overall matrix that I needed Code:
test <- as.matrix(read.csv(file="file.csv", sep=",", header=FALSE)) result<- cosine(t(test)) result-files <- (result[7:12,1:6]) I know that is not the best solution but it was easier as I am new to both languages I have tried to get R running in cygwin but didnt manage... so now I am wondering whether it is possible to do cosine similarity calculations in unix... is there any shortcuts on doing so? I a working on windows Vista Cheers |
|
#4
|
|||
|
|||
|
Solved the problem by working on a Linux machine
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with merge data based on similarity | patrick87 | Shell Programming and Scripting | 1 | 12-19-2011 06:33 AM |
| building flat files in unix and importing them from windows | tunirayavarapu | UNIX for Advanced & Expert Users | 3 | 08-09-2004 09:54 AM |
| Importing a unix file dump into a PC capable database | DaltonF | UNIX for Dummies Questions & Answers | 7 | 07-23-2002 05:06 PM |
| importing database from unix to winnt | sadiecutie | UNIX for Dummies Questions & Answers | 4 | 08-16-2001 01:04 AM |
|
|