[R] GETTING CLUSTERING RESULTS IN SOM , LIKE K-MEAN

2014-05-23 Thread Ashis Deb
Hi all, I was doingk-mean clusteringthrough which i could find out each and every clusters and the contents aroundeach cluster centroid likebelow :- x<-read.csv("normalizedata.csv", header = TRUE)#To read the dataset km<- kmeans(

Re: [R] Balloon plot scaling problem

2014-05-23 Thread Jim Lemon
On Fri, 23 May 2014 12:19:11 PM Ruddy Kathy wrote: > Hi Guys, > > I have been trying to create a 'balloon plot' using R, which is where the > points in a plot are scaled such that the size of the point (area) > represents the value. > ... > Anybody got any ideas for how to change this scaling?? >

Re: [R] recode the ID with sequential order of a dataset

2014-05-23 Thread arun
Hi, May be this helps: #if the data is ordered for the "TIME" column as in the example dat <- read.table(text="ID TIME 1254 0 1254 1 1254 3 1254 5 1254 14 3236 0 3236 36 3236 93 1598 0 1598 0.5 1598 1 1598 2 1598 3 1598 12 1598 36 1598 75 1598 95 1598 120",sep="",header=TRUE)  dat$NewID <- with(

Re: [R] subsetting to exclude different values for each subject in study

2014-05-23 Thread arun
Hi, Sorry, there is a mistake. XO[2,] should be: XO[2,] <-  sapply(seq_along(col.tri.nb), function(i){ind1 <- as.character(ind[i]); ind2 <- as.character(ind[col.tri.nb[[i]]]); mean(abs(XO[1,ind1]-XO[1,ind2]))} ) A.K. On Friday, May 23, 2014 12:56 PM, arun wrote: Hi Monaly, May be this hel

Re: [R] How to illustrate data of a csv file as table (xtable?)

2014-05-23 Thread Duncan Murdoch
On 23/05/2014, 6:31 PM, Verena Weinbir wrote: Hello! I'd like to illustrate the data of an csv file as a nice table and copy it into my word-sheet. Currently, I am trying this with the xtable () function (latex output). I'm not sure what you mean by copying it into your word-sheet, but latex

[R] How to illustrate data of a csv file as table (xtable?)

2014-05-23 Thread Verena Weinbir
Hello! I'd like to illustrate the data of an csv file as a nice table and copy it into my word-sheet. Currently, I am trying this with the xtable () function (latex output). Example Code: dfchar <- data.frame(Author = dat$author, Year = dat$year, Age = dat$age) xtable(dfchar) Now, since there a

Re: [R] Error during working with wgcna and R

2014-05-23 Thread plangfelder
Hi, if you don't have enough memory to store the entire TOM within RAM, you cannot simply retrieve it and subset it. There are 3 options for what you want to do: 1. If all genes are in the same block, calculate the TOM from the block genes and subset it appropriately. This will exactly reproduce

Re: [R] how to add a table under a plot?

2014-05-23 Thread Greg Snow
There is an addtable2plot function in the plotrix package, which is on CRAN and can be installed using install.packages or other standard ways of installing packages. If you need the table to line up with parts of the plot then you could leave extra margin area and call the axis function multiple

Re: [R] how to add a table under a plot?

2014-05-23 Thread Kehl Dániel
Hi, the function is in the plotrix package, so you have to install and call that package first. After installing see example(addtable2plot). HTH, daniel Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; meghatalmazó: Helen Gao [helen

[R] Time Series

2014-05-23 Thread wayne schlemitz
Dear Sir: I am trying to plot a time series from the following code: test <- read.table("/home/wayne/inr2a.txt", header = TRUE, quote="", sep = ";") x2 <- ts(data=test, frequency = 80, start = c(2012,11), end = c(2014,5)) plot.ts(x2, xlab="Date", ylab="Inr", main="X2 - Time Series", ylim=c(1.0,4

[R] how to add a table under a plot?

2014-05-23 Thread Helen Gao
Dear all, If you know how to add a table under a plot, could you please send me your code? In R documentation, there is a function addtable2plot{}, do you know where to download the function? Thank you in advance, Helen [[alternative HTML version deleted]] _

Re: [R] Error message when fitting a binomial response model using glm

2014-05-23 Thread Adams, Jean
Roland, I did a google search for R Error: inner loop 2; cannot correct step size and found an old R-help message that suggests the glm() algorithm cannot converge. https://stat.ethz.ch/pipermail/r-help/2009-December/223142.html I get the same error message as you when I fit glm(cb

Re: [R] How to follow

2014-05-23 Thread Greg Snow
Here are some functions to look at for help with your problem (though as Sarah comments, it would be easier for us to help you if you help us by giving more detail as mentioned in the posting guide). The flush.console function will send output to the screen even when buffering is happening. The wi

Re: [R] How to follow

2014-05-23 Thread Sarah Goslee
Hi, On Fri, May 23, 2014 at 2:57 PM, Ragia Ibrahim wrote: > > Hi, > An R function that should be run for about 50 000 times... > during execution some data saved in data frame > how can I view the progress of the function, even its counter..? http://stackoverflow.com/questions/8450580/print-j-on

[R] How to follow

2014-05-23 Thread Ragia Ibrahim
F Hi, An R function that should be run for about 50 000 times... during execution some data saved in data frame how can I view the progress of the function, even its counter..? there are print stamens inside the code but nothing show up till the end of the run !!! other thing, is there any

Re: [R] subsetting to exclude different values for each subject in study

2014-05-23 Thread arun
Hi Monaly, May be this helps: b<- 77:99 ao1 <- ao[-b,] ##Your code: XO<- matrix( 0,6, 76, byrow=TRUE);XO abo<-ao$NestkastNummer[-b];abo  #removed values that were NA rownames(XO) = c("EB_score","avg","pop_size","pop_avg_score", "adj_pop_avg", "ind_pop_dif") colnames(XO) = abo t <- ao$COR_LOC;t i

Re: [R] data frame sample

2014-05-23 Thread arun
Hi, May be this helps: dat1 <- as.data.frame(matrix(1:(640*5), ncol=5,byrow=TRUE))  set.seed(41)  indx <-sample(nrow(dat1),nrow(dat1),replace=FALSE) lst1 <- lapply(split(indx,as.numeric(gl(640,64,640))),function(x) dat1[x,]) A.K. Dear all, I have a data frame (d) composed of 640 observations fo

Re: [R] Inconsistent alphabetisation issue

2014-05-23 Thread peter dalgaard
Try Sys.getlocale() on the two machines and see if you're not getting different results. Collating sequence differs even between different flavors of English. E.g., some sort AaBbCb, others ABC..abc and the handling of spaces and punctuation charactes can differ too. (Something's not quite

Re: [R] Bayesian HMM

2014-05-23 Thread Sarah Goslee
A search at www.rseek.org for Bayesian "hidden Markov model" turns up all sorts of potentially-useful information. Sarah On Fri, May 23, 2014 at 6:09 AM, Bukar Alhaji wrote: > Dear R buddies, > > I have this data X <- c(3 5 7 6 40 9 9 2 5 1 4 7 5 45 9 48 10 6 > 3 6 4 9 5 5 4

Re: [R] Bayesian HMM

2014-05-23 Thread Ingmar Visser
Searching on r-project for bayesian hidden Markov model gives several potentially useful links: https://www.google.com/search?q=bayesian+hidden+markov+model&domains=r-project.org&sitesearch=r-project.org&btnG=Google+Search hth, Ingmar On Fri, May 23, 2014 at 12:09 PM, Bukar Alhaji wrote: > Dea

Re: [R] GETTING SOM CLUSTERING RESULT

2014-05-23 Thread Sarah Goslee
Hi, You're probably not getting replies because you're not asking very clear questions: see the posting guide for more suggestions, but at the very minimum you need to tell us what functions you're using - it's rather hard to answer otherwise. Even better, provide a reproducible example as the po

[R] GETTING SOM CLUSTERING RESULT

2014-05-23 Thread Ashis Deb
Hi all, I have a normalized data set , in which i had done SOM clustering , as we can get clustering results in kmeans like :-k$cluster , we can get which element belongs to which cluster . But in case of SOM , can we g

Re: [R] Zip multiple files with same prefix?

2014-05-23 Thread Ista Zahn
Something like files <- list.files() groups <- unique(substr(files, 1, 7)) for(goup in groups) { zip(paste0(group, ".zip"), grep(group, files, value=TRUE)) } should get you started. Best, Ista On Thu, May 22, 2014 at 3:34 PM, mr_kirkwood wrote: > I have thousands of files that need to b

[R] Bayesian HMM

2014-05-23 Thread Bukar Alhaji
Dear R buddies, I have this data X <- c(3  5  7  6 40  9  9  2  5  1  4  7  5 45  9 48 10  6  3  6  4  9  5  5  4 64  3 23 26  4  3  5  2  7  3 10  3  4 51 67  6  4  4  6  6   5 11  7  3  5) I would like to try a Bayesian method for the parameter estimation of the Hidden Markov model.  Could

[R] Inconsistent alphabetisation issue

2014-05-23 Thread Stefano Conti
Dear R users community, For some time now I have occasionally observed some inconsistent behaviour across identical (i.e. same 3.1.0 version and set-up / configuration) R installations on separate Linux machines (all manufactured in the UK). Specifically, after reading (via 'rea

[R] snpStats reference allele used in genetic associations?

2014-05-23 Thread francesca casalino
Hi, Does anyone know how to find the reference allele used for genetic associations ran in snpStats? I have ran several associations using snp.rhs.tests, but I cannot tell which allele was used as the "effect allele". Is it the one coded as "Al1" in the SNP.support file? I can find the RAF (risk

[R] Balloon plot scaling problem

2014-05-23 Thread Ruddy Kathy
Hi Guys, I have been trying to create a 'balloon plot' using R, which is where the points in a plot are scaled such that the size of the point (area) represents the value. Eg. A small point may represent 2 and a big point may represent 10. The problem is that my data range between 0.3 and 0.52, wh

Re: [R] Zip multiple files with same prefix?

2014-05-23 Thread arun
Hi, May be this helps: #If you are okay with compressed tar files ##If the files are all in the working directory  vec1 <-  list.files() vec1 #[1] "40111h162n.csv"  "40111h1n49.txt"  "40111_h1n4.txt"  "40111h1n50.txt" #[5] "40111h2mn52.csv" lst1 <- split(vec1,substr(vec1,1,7)) #Create the su

[R] Error message when fitting a binomial response model using glm

2014-05-23 Thread Roland Deutsch
Dear R-help, during a simulation study using glm, I got the following error message for which I cannot determine the cause: Error: inner loop 2; cannot correct step size Below is the code for which this error occurred is clog<-function(){ linkfun<-function(mu) qexp(mu) linkinv<-function(

Re: [R] subsetting to exclude different values for each subject in study

2014-05-23 Thread Monaly Mistry
Hi Arun and Frede, So the dput() is below (it's the same data file as before), but below that is the code I used to make the tessellation. Thanks for your help. > dput(ao) structure(list(num = 1:99, FORM_CHK = c(20870L, 22018L, 30737L, 22010L, 22028L, 36059L, 36063L, 36066L, 30587L, 30612L, 3605

Re: [R] subsetting to exclude different values for each subject in study

2014-05-23 Thread Frede Aakmann Tøgersen
Hi Monaly I guess that if you made the neighborhood data available (using dput()) then Arun will easily show you how to automatically with only a couple of code lines instead of those many lines you had to make by hand. Have a nice day. Yours sincerely / Med venlig hilsen Frede Aakmann Tøge

Re: [R] subsetting to exclude different values for each subject in study

2014-05-23 Thread Monaly Mistry
Hi, I did use the library deldir, I didn't put that code in since I wasn't sure if it was really relevant to the question as I just made the tesselations identifying which tessellation belonged to which individual. Following that I by hand recorded which individuals were sharing a boundary with e

Re: [R] Loop Issue

2014-05-23 Thread arun
Hi, You may also try: fun1 <- function(n, repl, val1, val2) {     mat1 <- suppressWarnings(replicate(repl, log(runif(n, val1, val2     mat1[!is.na(mat1)][seq(n)] } #Jim's function fun2 <- function(init, final, val1, val2) {     i <- init     while (i < final) {     u <- runif(1, val1, val2

Re: [R] Voronoi-Diagrams in R

2014-05-23 Thread Raphael Päbst
Ok, now I'm scared. I copied the exact code from your post and got length(tri) = 1481 and dim(geodel) = 15773 You are right though, there seem to bee duplicates in my original bm, but removing them still got diffeent results. I fear there's something weird going on with my R installation. Che

Re: [R] Loop Issue

2014-05-23 Thread Jim Lemon
On Thu, 22 May 2014 09:11:43 PM Ricardo Rocha wrote: > Hi everybody. > > Consider the following exampling code: > > x=numeric() > for(i in 1:10){ > u=runif(1,-1,2) > x[i]=log(u) > } > This code, in each interation, generates a random value in the (-1,2) > interval and then calculates