Re: [R] Question Regarding a nested for loop in R

2015-12-03 Thread David Winsemius
> On Dec 3, 2015, at 2:42 PM, Vermilio, Ryan wrote: > > Hello there, > > I'm an R novice and am trying to figure out how to create an external for > loop. My current loop iterates 15 times and stores the resulting values in 3 > separate vectors. What I need is

Re: [R] Tktable do not expand inside a Tkframe

2015-12-03 Thread phgrosjean
Instead of using tkgrid(), you can do this with tkpack(). Replace: > tkgrid( tableData, scrY ) > tkgrid.configure( scrY, sticky="nsw") > tkgrid( scrX, sticky="new" ) by: scrYwidth <- as.integer(tkcget(scrY, width = NULL)) tkpack(scrY, side = "right", fill = "y", expand = FALSE, pady = c(0,

Re: [R] Strange error

2015-12-03 Thread Jim Lemon
Hi Nick, I think that Jeff may be correct in that the code was cut and pasted from a non-text application. In particular, the error message about "*" is suspicious. What may be happening is that when you select a single line, it only picks up the text, but when you select multiple lines, the

[R] Question Regarding a nested for loop in R

2015-12-03 Thread Vermilio, Ryan
Hello there, I'm an R novice and am trying to figure out how to create an external for loop. My current loop iterates 15 times and stores the resulting values in 3 separate vectors. What I need is to create an outside loop that will run internal loop 4 times, sum the resulting vectors for

Re: [R-es] igraph o network

2015-12-03 Thread Javier Rubén Marcuzzi
Algo pude avanzar, no con fastgreedy.community, pero otros algoritmos procesan, claro que tengo que estudiar lo que informan porque puede ser que la parte biológica no tenga nada que ver, un algoritmo me mezcla razas con drogas. Por otro lado el número de grupos es muy alto, o dicho de otra

[R] Strange error

2015-12-03 Thread Nicolae Doban
Hi, recently I received a strange error after running my code in chunks. But, I don't get any errors when I run it line by line. Also, what is strange is that the error message is misspelled This is the error messages I get *> setwd("H:/XX/XXX")* *"rror: unexpected input in

[R] Problems trying to generate a prime factor vector

2015-12-03 Thread Kevin Wright
Hi, I am very new to 'R' and am trying to write an R function which returns the prime factors of a given number(n) Unfortunately, the function only works for very small numbers, if for example I pass 18 to the function a mysteriously long vector is returned. I have not been able to find where or

[R] Bug in truncdist package

2015-12-03 Thread dario.romare
library(truncdist) When running the following code, the output from extrunc() and vartrunc() is correct: # Mean and variance of Gamma distribution m <- 40; v <- 9 # Derive shape and scale parameters a <- m^2/v; s <- v/m # Checks: mean=shape*scale, variance=mean*scale^2 a*s; a*s^2 # Generate

Re: [R] fill the area outside a polygon

2015-12-03 Thread Adrian Dușa
On Wed, Dec 2, 2015 at 10:38 PM, Michael Sumner wrote: > > On Wed, 2 Dec 2015 at 23:10 Adrian Dușa wrote: > >> Dear All, >> >> I know how to fill a polygon, using a basic R graphics device: >> >> par(mai=c(0, 0, 0, 0)) >> plot(1:100, type="n") >>

[R] expand dataframe but time gap is not the same

2015-12-03 Thread Dagmar
Hello, I hope someone can help me with my problem: I have a dataframe like this: datframe <- data.frame(dates=c("02.08.2013","03.08.2013","03.08.2013"), times =c("22:10","4:04", "10:18"), tide =c("NW","HW", "NW")) datframe Timestamp <- paste(datframe$dates, datframe$times) myframe2 <- cbind(

Re: [R-es] igraph o network

2015-12-03 Thread Javier Rubén Marcuzzi
Estimado Carlos J. Gil Bellosta Muchas gracias, hay un progreso pero …, por pasos. Los datos no son muchos, los tomé de los casos clínicos de oftalmología veterinaria en el hospital de la facultad, dos años de escribir a mano, estoy trabajando para informatizarlo pero aún falta (me interesa

Re: [R] fill the area outside a polygon

2015-12-03 Thread Adrian Dușa
Hi Greg, On Wed, Dec 2, 2015 at 10:28 PM, Greg Snow <538...@gmail.com> wrote: > > Adrian, > > Draw the polygon once without the border and the whole in it, then go > back and draw the border around the outer polygon without any fill. I thought about it too, but this only works on a Windows

Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Franklin Bretschneider
Hi Kevin Wright, Re: > > I am very new to 'R' and am trying to write an R function which returns the > prime factors of a given number(n) > > Unfortunately, the function only works for very small numbers, if for > example I pass 18 to the function > a mysteriously long vector is returned. I

Re: [R] Strange error

2015-12-03 Thread PIKAL Petr
Hi You are probably not telling a whole story and what is worse, you are telling the story in HTML, which is hard to read. I get these sorts of errors > setwd("U:/data") Error in setwd("U:/data") : cannot change working directory > > setwd(D:/xxx/xxx) Error: unexpected '/' in "setwd(D:/" >

Re: [R] Strange error

2015-12-03 Thread Jeff Newmiller
You are posting in html format on a plain text mailing list, so we are not seeing what you sent. If you are being similarly careless with your data files then you may have corrupted the data. Do not use a word processor with R code or data files. -- Sent from my phone. Please excuse my

Re: [R] expand dataframe but time gap is not the same

2015-12-03 Thread PIKAL Petr
Hi I am not completely sure what you want. Maybe something like datframe$datum<-strptime(paste(datframe[,1], datframe[,2]), format="%d.%m.%Y %H:%M") datframe$datum <- strptime(format(datframe$datum, "%d.%m.%Y %H"), format="%d.%m.%Y %H") datframe$datum<-as.POSIXct(datframe$datum)

Re: [R] looping through rows of a logical matrix for combination with and testing of a numeric vector

2015-12-03 Thread debra ragland via R-help
Or sorry, I should clarify, I struggle with putting components together when it comes to looping. On Thursday, December 3, 2015 11:43 AM, debra ragland wrote: Thanks again! And no Bert, this is not homework. I have a very minimal background in R and struggle with

Re: [R] Bug in truncdist package

2015-12-03 Thread David Winsemius
> On Dec 3, 2015, at 2:03 AM, > wrote: > > > library(truncdist) > > When running the following code, the output from extrunc() and vartrunc() is > correct: > snipped > > However, changing the mean from 40 to 44: > m <- 44; v <- 9 >

Re: [R] looping through rows of a logical matrix for combination with and testing of a numeric vector

2015-12-03 Thread debra ragland via R-help
Thanks again! And no Bert, this is not homework. I have a very minimal background in R and struggle with putting concepts together. But thanks anyway. On Thursday, December 3, 2015 11:04 AM, Boris Steipe wrote: Use your logical vector to extract the x, y values

Re: [R] looping through rows of a logical matrix for combination with and testing of a numeric vector

2015-12-03 Thread Boris Steipe
Use your logical vector to extract the x, y values for the test from the rows of the matrix: x <- mat[3, x2] y <- mat[3, !x2] Or: use the formula version of wilcox.test as explained in ?wilcox.test B. On Dec 3, 2015, at 10:28 AM, debra ragland via R-help wrote: >

[R] looping through rows of a logical matrix for combination with and testing of a numeric vector

2015-12-03 Thread debra ragland via R-help
I have read in a sequence alignment and have done the necessary steps to separate and store the elements of the original input into a new list of character vectors. I have compared the sequence list to a "standard" vector, such that the return is a matrix of logical values indicating TRUE if

[R] sem-package for categorical and multiply imputed data

2015-12-03 Thread Lorenz, Jennifer
Hi, can anyone recommend a package for structural euqation models with binary outcomes that is able to pool for multiply imputed datasets and calculate cluster-robust standard errors? I tried lavaan.survey from the package lavaan.survey, but unfortunately it does not support categorical data

Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Boris Steipe
It's very commendable that you try writing your own functions to learn R. Of course the function factorize() is in gmp, but that's beside the point. Your code looks messy - before asking your question you could have removed all these print statements. It gets further messed up because you

Re: [R] looping through rows of a logical matrix for combination with and testing of a numeric vector

2015-12-03 Thread Bert Gunter
I should have added -- is this homework? There is a no homework policy on this list. Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Thu, Dec 3, 2015 at 7:54 AM, Bert Gunter wrote: >

Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Boris Steipe
* ... in the same vector. On Dec 3, 2015, at 10:48 AM, Boris Steipe wrote: > It's very commendable that you try writing your own functions to learn R. Of > course the function factorize() is in gmp, but that's beside the point. > > Your code looks messy - before

Re: [R] R-help mailing list

2015-12-03 Thread Sarah Goslee
You need to start with a basic understanding of how R works. Here are a couple of sources that might help you get started: http://www.burns-stat.com/documents/tutorials/impatient-r/ http://cyclismo.org/tutorial/R/ Sarah On Thu, Dec 3, 2015 at 4:51 PM, Saba Sehrish via R-help

[R] R-help mailing list

2015-12-03 Thread Saba Sehrish via R-help
Hi   I am a PhD student and I want to learn how to run Linear regression with Lag-5 on R through "For Loop". Please find the details below:   1-            I need guidance about Coding/ Programming for Simple Linear Regression with Lag-5 on R. 2-   I have time series data of “Daily

[R] Survival analysis: ERROR: Time and status are different lengths

2015-12-03 Thread Marleen Hamoen
Hi, I am fitting an AFT model assuming a Weibull distribution and I would like to check the residuals compared to the Kaplan Meier residuals, but when I try to create the Kaplan Meier residuals I get an error: Time and status are different lengths. I am using the following script: # Fitting the

Re: [R] system.file(...) self-referencing the containing package

2015-12-03 Thread William Dunlap
Every package has in it, after it is installed, a character object called ".packageName" containing its name. It is not exported from the package. Functions in your package can refer to it as just .packageName. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Dec 3, 2015 at 5:28 PM, Murat

[R] system.file(...) self-referencing the containing package

2015-12-03 Thread Murat Tasan
In a package I'm writing, I'm placing all SQL code here: /inst/sql/ And so when referring to these blocks of code from the package's R code, I do something like so: system.file("sql", "my_example_file.sql", package = "ThisPackage", mustWork = TRUE) But, referring to the package itself with the

[R] Tktable do not expand inside a Tkframe

2015-12-03 Thread Cleber N.Borges
hello all, I'm trying to build a table within a frame. I would like the table to expand when the entire window is expanded. I could not find examples of how to solve this problem. I thank you in advance for help. Cleber ### # piece of the code library(