Re: [R] how to analysisi spectrum of a dataset with NA value

2013-12-18 Thread Jeff Newmiller
This behavior is typical for fast Fourier Transform algorithms. You need to decide what theory you want to use in dealing with your missing data, and apply that yourself. There are some packages that can help you (e.g. Lomb-Scargle or discrete slow Fourier transform). Search with package sos or

[R] multicore and mclapply problem in calculation server

2013-12-18 Thread Juan Antonio Balbuena
Hello I am using package multicore for parallel computing in a Altix UltraViolet 1000 server with 64 CPUs and 960 GB of RAM memory. Access is managed by means of a SGE queue system. This is the first time I am using parallel computing and my experience with supercomputers is quite

[R] Tinn-R user list on Google groups

2013-12-18 Thread Jose Claudio Faria
Dears Tinn-R users, Below a link to the new user list on Google groups: https://groups.google.com/forum/#!forum/tinn-r All the best, -- ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\ Jose Claudio Faria Estatistica UESC/DCET/Brasil joseclaudio.faria at gmail.com Telefones: 55(73)3680.5545 -

Re: [R] ifelse statement with two vectors of different length

2013-12-18 Thread arun
Hi, Please show a reproducible example. countrydiff - c(Albania, Algeria, Belarus, Canada, Germany) long_df - data.frame(country_name = c(Algeria, Guyana, Hungary, Algeria, Canada, Iran, Iran, Norway,Uruguay, Zimbabwe) )  ifelse(long_df$country_name %in% countrydiff,1,0) # [1] 1 0 0 1 1 0 0 0 0

[R] ifelse statement with two vectors of different length

2013-12-18 Thread Adel
Dear list-members, I have the following problem: I have a vector (countrydiff) with length 72 and another vector (long_df$country_name) which is about 12000 long. Basically what I want to do is to if the factor level (or string name) in long_df$country_name appears on the countrydiff, then

[R] calculating power function

2013-12-18 Thread mb
Hello, i know there are several functions on r to calculate the power of a test. f.e the functions of pwr packet. In this packet the use the power function (1-\beta) to calculate. My question is how we get this function for anova (pwr.anova.test)? I know that 1-\beta=P(H1|H1) =

[R] 3D Surface plot

2013-12-18 Thread Simon Delay-Fortier
Hi everyone, I am a very new user of r (doing most of my previous stuff in vba). I am now mandated to draw a 3-d surface of a mine pit hole. I have all the location points (around 5000 points) of the pit in a CSV file under 3 column X, Y Z. However, going from page to page on the web, I could

[R] ANOVA repeated mesures

2013-12-18 Thread Mª Teresa Martinez Soriano
Hi to everyone, I am tring to make a Anova with repeated measures,my data set looks like: participantes - c(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8) grupo - factor(c(rep(A, 8), rep(B, 8), rep(C, 8)))valor - c(1, 2, 4, 1, 1, 2, 2, 3, 3, 4, 4, 2, 3, 4, 4, 3, 4, 5,

Re: [R] read .slk file

2013-12-18 Thread PIKAL Petr
Hi Extension does not specify file format. You can rename any file with any extension without changing its nature. However slk stays for symbolic link and therefore it just brings actual file to Excel. Maybe you could start to play with

Re: [R] ifelse statement with two vectors of different length

2013-12-18 Thread Adel
Dear Arun Thanks for your reply, it made me realize that the problem was not in the code but in the levels() of the factors. Some countries had some extra spacing which made the ifelse() function not work. So if I modify your code (added space to countrydiff), it will then look something like

Re: [R] ifelse statement with two vectors of different length

2013-12-18 Thread arun
Hi Adel, If the problem is the spacing, then library(stringr) 1*(long_df$country_name %in% str_trim(countrydiff)) # [1] 1 0 0 1 1 0 0 0 0 0 A.K. Dear Arun Thanks for your reply, it made me realize that the problem was not in the code but in the levels() of the factors. Some countries had

[R] 3D Surface Plot

2013-12-18 Thread Simon Delay-Fortier
Hi everyone,I am a very new user of r. I am now mandated to draw a 3-d surface (and possibly rotating) of a mine pit hole. I have all the location points (around 5000 points) of the pit in a CSV file under 3 column X, Y Z. The fllowing gives a 3d scatter but i would like to have a surface.

Re: [R] 3D Surface plot

2013-12-18 Thread Barry Rowlingson
On Wed, Dec 18, 2013 at 2:52 PM, Simon Delay-Fortier simon.delay-fort...@mail.mcgill.ca wrote: Hi everyone, I am a very new user of r (doing most of my previous stuff in vba). I am now mandated to draw a 3-d surface of a mine pit hole. I have all the location points (around 5000 points) of

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread Simon Kiss
Thanks! that works, more or less. Although the wonky behaviour of mapply that David pointed out is irritating. I tried deleting the $call item from the models produced and passing them to stargazer for reporting the results, but stargazer won't recognize the results even though the class is

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread Simon Kiss
Dennis, how would your function be modified to allow it to be more flexible in future. I'm thinking like: f - function(x='Dependent variable', y='List of Independent Variables', z='Data Frame') { form - as.formula(paste(x, y, sep = ~ )) glm(form, data =z) } I tried that then using

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread Bert Gunter
Folks: 1. Haven't closely followed the thread. I'm responding only to Simon's post. 2. ?formula ## Especially note the use of . So just make an appropriately constructed data frame for the data argument of glm: ## example df - data.frame(y=rnorm(9),x1=runif(9), x2=1:9) glm(y~.,data=df) ## y

[R] How to manipulate this data?

2013-12-18 Thread Nitisha jha
Hi, I want my output to be like this: Value BXR abc DHH abc DHK abc def DSL def ghi DSM abc def ghi DSS def ghi DST ghi DIW abc DIL abc ghi My input dataset is this with colnames name and Value: name Value abc BXR abc DHH abc DHK def DHK def DSL ghi DSL abc DSM def DSM ghi

Re: [R] estimating survival function from Cox model

2013-12-18 Thread Terry Therneau
The standard error of the curve cannot be extracted from the summary information you have. The variance is made up of two terms, one of which is a sum over all the death times, of a quadratic term per death time. That term involves the variance matrix of the Cox model coefficients, the target

Re: [R] How to manipulate this data?

2013-12-18 Thread arun
Hi, Try: dat1- read.table(text=name Value   abc BXR   abc DHH   abc DHK   def DHK   def DSL   ghi DSL   abc DSM   def DSM   ghi DSM   def DSS   ghi DSS   ghi DST   abc DIW   abc DIL   ghi DIL,sep=,header=TRUE,stringsAsFactors=FALSE) aggregate(name~Value,data=dat1,paste,collapse= ) #or

[R] Predicting response from fitted linear model with incomplete new sample data

2013-12-18 Thread Chris Wilkinson
I would like to predict a new response from a fitted linear model where the new data is a single case with a missing value. My reading of the help on predict() is inconclusive on whether this is possible. Leaving out the missing value or setting it to NA both fail but differently, see example

[R] plot() function: color transparency

2013-12-18 Thread capricy gao
I found all the color transparency was defined with character color, or rgb color. What if I have number code and still try to modify the transparency? For example: x=c(1:5) color=c(2,2,3,4,5) plot(x, col=color) plot(x, col=color,pch=20) here I defined color by numbers, how can I modify the

Re: [R] Coxph convergence

2013-12-18 Thread Terry Therneau
I'll re-enter the fray. The data set is an example where coxph is incorrect; due to round off error it is treating a 5 column rank 3 matrix as if it were rank 4. This of course results in 0 digits of precision. Immediate fix, for the user, is to add toler.chol= 1e-10 to their coxph call.

Re: [R] plot() function: color transparency

2013-12-18 Thread Duncan Murdoch
On 13-12-18 2:08 PM, capricy gao wrote: I found all the color transparency was defined with character color, or rgb color. What if I have number code and still try to modify the transparency? For example: x=c(1:5) color=c(2,2,3,4,5) plot(x, col=color) plot(x, col=color,pch=20) here I

Re: [R] Predicting response from fitted linear model with incomplete new sample data

2013-12-18 Thread Rolf Turner
As far as I can discern, your question makes no sense at all. Suppose you *know* that y = 2 + 3*x1 + 4*x2. Now what should you predict when x1 = 6 (with x2 missing/unknown)? See fortune(magic). On 19/12/13 07:18, Chris Wilkinson wrote: I would like to predict a new response from a fitted

Re: [R] Using assign with mapply

2013-12-18 Thread Greg Snow
The take home message that you should be learning from your struggles is to Not Use The 'assign' Function! and Do Not Use Global Variables Like This. R has lists (and environments) that make working with objects that are associated with each other much simpler and fits better with the functional

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread William Dunlap
Try something like the following. Because lm() evaluates many of its arguments in nonstandard ways, f() manipulates the call and then evaluates it in the frame from which f() was called. It also puts that environment on the formula that it creates so it can refer to variables in that environment.

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-18 Thread Greg Snow
Another option to consider if your goal is to create a word file with 1 or more plots in it (possibly intermingled with text and other output) is to use the knitr or pander packages (or odfWeave or sweave or ...). This way you can create a script (or template file) that sets a couple of options

[R] Problems with Installing R ('failure to expand shell folder constant userdocs)

2013-12-18 Thread Barry DeCicco
  Hello,   I’m trying to install R 3.02 for windows on a Windows 7 machine (we were just upgraded from Windows XP). It’s a networked machine in a work environment.  I have administrator rights. Program files go on C; data is stored on D (it's a partitioned drive).   I get the message

Re: [R] plot() function: color transparency

2013-12-18 Thread capricy gao
I checked as you suggested. However, I found that the number in those functions are the number of colors. In contrast, my number here means a specific color, for example, 2 in my code means red, 3 in my code means green On Wednesday, December 18, 2013 1:18 PM, Duncan Murdoch

Re: [R] plot() function: color transparency

2013-12-18 Thread Christoph Scherber
you will need to specify colours as RGB values and then set transparency via the alpha argument. e.g.: color=rgb(0,0,0,alpha=0.3) # will give black (0,0,0) and a transparency of 30%. Best wishes Christoph On 18/12/2013 23:23, capricy gao wrote: I checked as you suggested. However, I found

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-18 Thread Kevin Wright
Another nice thing about your solution is that circles look like circles, and not like diamonds (when viewed on screen). Thanks. Kevin Wright On Mon, Dec 16, 2013 at 8:02 PM, Steve Taylor steve.tay...@aut.ac.nzwrote: Unfortunately the win.metafile() device does not support semi-transparent

Re: [R] plot() function: color transparency

2013-12-18 Thread Richard Kwock
As Duncan suggested, this will probably get you what you want. You can set the transparency using alpha.f in adjustcolor(). x - c(1:5) color - c(2,2,3,4,5) color_transparent - adjustcolor(color, alpha.f = 0.3) plot(x, col = color, pch = 20, cex = 4) plot(x, col = color_transparent, pch = 20,

Re: [R] plot() function: color transparency

2013-12-18 Thread Duncan Murdoch
On 13-12-18 5:23 PM, capricy gao wrote: I checked as you suggested. However, I found that the number in those functions are the number of colors. In contrast, my number here means a specific color, for example, 2 in my code means red, 3 in my code means green You didn't read very

Re: [R] binary symmetric matrix combination

2013-12-18 Thread arun
Hi, You could try: Either: dat1 - read.table(Test.txt,header=TRUE) dim(dat1) #[1] 4735 4735 dat2 - read.table(1991res.txt,header=TRUE) dim(dat2) #[1] 574 574 m1 - as.matrix(dat1) m2 - as.matrix(dat2) library(data.table) d1 -

[R] plot different groups as factors

2013-12-18 Thread Luigi Marongiu
dear all, i would like to plot the value of different response groups. when i simply use plot(y ~ x) i obtain a series of boxplots. i would rather use dots. i also tried with stripchart(y ~ x), which gives better results but does not place properly the labels since place them alphabetically. in

[R] assessment of validity of PLS predictions

2013-12-18 Thread dx 5212
Hello, I've built a PLSR model to predict the concentrations of mixture components from experimental data using the 'pls' library. I calculated the Q residual (or lack of fit) and T squared value for each of the samples used to build the model in order to assess how well each sample is described

Re: [R] read .slk file

2013-12-18 Thread Jeff Newmiller
I suspect this could be SYLK format, a very old spreadsheet exchange format. The only hit that I get from RSiteSearch(sylk) is read.gnumeric.sheet, which depends on an external program ssconvert to extract CSV. In the plus department, it is a text-based format that has been implemented numerous

Re: [R] plot different groups as factors

2013-12-18 Thread Jim Lemon
On 12/19/2013 11:18 AM, Luigi Marongiu wrote: dear all, i would like to plot the value of different response groups. when i simply use plot(y ~ x) i obtain a series of boxplots. i would rather use dots. i also tried with stripchart(y ~ x), which gives better results but does not place properly

Re: [R] Welcome to the R-help mailing list

2013-12-18 Thread Lydia Keppler
Hi there, I am new to R and programming in general and am looking for help with writing a function with dates and times. I have checked around but am still a bit stuck. Basically, I have data in the format dd/mm/ HH:MM and I have to calculate how much time has passed between various events.

Re: [R] Welcome to the R-help mailing list

2013-12-18 Thread jim holtman
use POSIXct instead of Date: x - c(2013-12-12 12:00:00, 2013-12-15 03:15:23) # convert using as.POSIXct times - as.POSIXct(x, format = %Y-%m-%d %H:%M:%S) times [1] 2013-12-12 12:00:00 EST 2013-12-15 03:15:23 EST difftime(times[2], times[1], units = 'secs') Time difference of 227723 secs

[R] GLMM parameter estimates giving opposite trends

2013-12-18 Thread Diana Virkki
I apologize if this is a simple question. I am running GLMM's using glmmML and model averaging with MuMIn. One of the parameter estimates for a parameter (firefreq) in the best model is giving a positive number, where in reality I know this to be a negative correlation. I have checked and double

Re: [R] Problems with Installing R ('failure to expand shell folder constant userdocs)

2013-12-18 Thread Prof Brian Ripley
You didn't say what gave that message (and there is no 'R 3.02': did you mean 3.0.2?). If this came from the installer, that is not part of R: look for info on 'Inno Setup'. On 18/12/2013 21:43, Barry DeCicco wrote:  Hello,  I’m trying to install R 3.02 for windows on a Windows 7