[R] Dataframe modification
Hello, I have a problem and wish if anybody have a quick solution or function or if this question was asked before and you could give me the date to look in the archives for the response. My problem is that I have a dataframe D[663,40] with only one column with repeated values lines and a factor with 4 levels. I want to reorganize my dataframe, create a dataframe D1[x,40*4] and put the repeated values in one line so that all the factors will be in columns. For the values with a missing level factor I want to keep empty the concerning place. For example if i a have this dataframe: A B C 32 a 14 32 b 22 55 a 44 55 b 77 55 c 55 55 d 44 83 c 77 83 d 55 83 e 44 I want to transform it to have this one: 32 a 14 b 22 55 a 44 b 77 c 55 83 c 77 d 55 e 44 Thanks best regards __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Problem with installation under R 1.7.1 and unzip
Thanks a lot professor, but no in fact it is like you've said c:\Program Files\R\rw1071\Rwork is my Working directory = C:\Program Files\R\rw1071\Rwork, i am in fact using the functions you've gave me to know what is happening with me because with R 1.6.2 i could install my packages with no problem like that, and i didn't change anything after uninstalling R 1.6.2 and installing R 1.7.1 (except of course in the propreties of R 1.7.2 Shortcut) zip.unpack(sma,dirperm) [1] 1 attr(,extracted) character(0) Warning message: error 1 in extracting from zip file options(unzip) $unzip [1] internal and this is what i got after the error message of packages installation traceback() 9: zip.unpack(pkg, tmpDir) 8: unpackPkg(foundpkgs[okp, 2], pkgnames[okp], lib, installWithVers) 7: install.packages(select.list(a[, 1], , TRUE), .libPaths()[1], available = a, CRAN = getOption(BIOC)) 6: eval(expr, envir, enclos) 5: eval(quote({ a - CRAN.packages(CRAN = getOption(BIOC)) install.packages(select.list(a[, 1], , TRUE), .libPaths()[1], available = a, CRAN = getOption(BIOC)) }), new.env()) 4: eval(expr, envir, enclos) 3: eval(expr, p) 2: eval.parent(substitute(eval(quote(expr), envir))) 1: local({ a - CRAN.packages(CRAN = getOption(BIOC)) install.packages(select.list(a[, 1], , TRUE), .libPaths()[1], available = a, CRAN = getOption(BIOC)) }) thanks again Ramzi - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Code for Support Vector Clustering Algorithm
No comment, svm package:e1071 R Documentation Support Vector Machines Description: `svm' is used to train a support vector machine. It can be used to carry out general regression and classification (of nu and epsilon-type), as well as density-estimation. A formula interface is provided. David Meyer [EMAIL PROTECTED] wrote: On 2003.06.12 09:15, Uwe Ligges wrote: Iouri Tipenko wrote: Dear R-Users, I'm a master student in Mathematics and Statistics at Carleton University, Ottawa, Canada. I'm studying Clustering methods including different related algorithms. One of them is Support Vector Clustering algorithm. I was wondering whether anybody implemented this algorithm and could help me with the S-Plus or R computer code that I could use in my simulations. I would really appreciate your help or any advise on where I can get this code. There is an implementation of Support Vector Machines in package e1071, which is available on CRAN. ...but it does not include Support Vector *clustering*. David __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help - [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Basic question on applying a function to each row of a dataframe
Another another neat way is: DF - data.frame(x=1:4, y=rep(1,4)) foo - function(z,x,y)z[x]+z[y] apply(DF,1,foo,x=x,y=y) 1 2 3 4 2 3 4 5 or DF - data.frame(x=1:4, y=rep(1,4)) foo - function(z)z-x+y foo(DF) [1] 2 3 4 5 Liaw, Andy [EMAIL PROTECTED] wrote: Another neat way is: with(DF, foo(x, w)) HTH, Andy -Original Message- From: peter leonard [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 4:35 PM To: [EMAIL PROTECTED] Subject: [R] Basic question on applying a function to each row of a dataframe Hi, I have a function foo(x,y) and a dataframe, DF, comprised of two vectors, x w, as follows : x w 1 1 1 2 2 1 3 3 1 4 4 1 etc I would like to apply the function foo to each 'pair' within DF e.g foo(1,1), foo(2,1), foo(3,1) etc I have tried apply(DF,foo) apply(DF[,],foo) apply(DF[DF$x,DF$w],foo) However, none of the above worked. Can anyone help ? Thanks in advance, Peter __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- Notice: This e-mail message, together with any attachments, cont... {{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help - [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Loops question
Hello Mr Ripley, i was waiting you to ask and if you don't mind if there is a fast way in R to do these loops made with R and that takes a week because my matrix is with thousand of rows. I got another method that is more fast and is utilised by many packages : interfacing with other languages, but it is only a question for information foo-function() {for (i in 1:(n-1)){ for (k in (i+1):n){ b_0 for (j in 1:m){ if(bin[i,j]==TRUEbin[k,j]==TRUE) b_b+1} print (b) } } } Thanks a lot Ramzi - [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Memory size of R
Hi all, anybody know how much can the memory size of R be settled?ThxRamzi - [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help