[R] Fwd: Converting Lat Lon data in coordinates in R

2014-07-24 Thread Suparna Mitra
Hi ​Hello , ​Can anybody please let me know how can I convert Lat/Lon data in coordinates in R. I was trying to use the rgdal package ​ and proj4 package​ . But being bit confused how to use S or N information. ​and degree min second information. Any example help will be great.​ My da

Re: [R] working on a data frame

2014-07-24 Thread Peter Alspach
Tena koe Matthew " Column 10 contains the result of the value in column 9 divided by the value in column 8. If the value in column 8==0, then the division can not be done, so I want to change the zero to a one in order to do the division.". That being the case, think in terms of vectors, as S

Re: [R] XLConnect on Linux Mint Maya

2014-07-24 Thread kw1958
John, I will look at your solution over the weekend. I looked into openxlsx but I don't think it handles named ranges which are useful. Thanks for your help, KW On Thursday, July 24, 2014, John McKown wrote: > On Thu, Jul 24, 2014 at 8:36 PM, Keith S Weintraub > wrote: > > Folks, > > > > I ha

Re: [R] XLConnect on Linux Mint Maya

2014-07-24 Thread John McKown
On Thu, Jul 24, 2014 at 8:36 PM, Keith S Weintraub wrote: > Folks, > > I have been trying to get XLConnect to work on my Linux Mint Maya machine. > > R works fine but this package doesn't seem to want to build. Here is the > message I get after supposedly building XLConnect and rJava: > > >>> req

Re: [R] working on a data frame

2014-07-24 Thread Matthew McCormack
On 7/24/2014 8:52 PM, Sarah Goslee wrote: > Hi, > > Your description isn't clear: > > On Thursday, July 24, 2014, Matthew > wrote: > > I am coming from the perspective of Excel and VBA scripts, but I > would like to do the following in R. > >

[R] XLConnect on Linux Mint Maya

2014-07-24 Thread Keith S Weintraub
Folks, I have been trying to get XLConnect to work on my Linux Mint Maya machine. R works fine but this package doesn't seem to want to build. Here is the message I get after supposedly building XLConnect and rJava: >> require(XLConnect) > Loading required package: XLConnect > Error : .onLoad

Re: [R] Retrieve Axis coordinates from map

2014-07-24 Thread David Winsemius
On Jul 24, 2014, at 2:05 PM, Julien Million wrote: > Hi, > > i want to automatise the creation of some maps with R, however, I would need > to be able to retrieve the coordinates of the axes that R is automatically > generated. > > When using the package MAPS, Case matters in R so this is th

Re: [R] Retrieve Axis coordinates from map

2014-07-24 Thread Peter Alspach
Tena koe Julien I don't use the maps package much, but I suspect par()$usr will allow you to do what you want. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Julien Million Sent: Friday, 25 July 2014 9:05

Re: [R] working on a data frame

2014-07-24 Thread Sarah Goslee
Hi, Your description isn't clear: On Thursday, July 24, 2014, Matthew wrote: > I am coming from the perspective of Excel and VBA scripts, but I would > like to do the following in R. > > I have a data frame with 14 columns and 32,795 rows. > > I want to check the value in column 8 (row 1) to s

Re: [R] R-3.1.1 - R CMD INSTALL problem

2014-07-24 Thread Eduardo M. A. M.Mendes
Many thanks. With 4.9.1 (as I did) no need to modify Depends. Ed PS. I have posted the question to R-devel mailing list. Many thanks. On Jul 24, 2014, at 8:52 PM, Jeff Newmiller wrote: > You need to rebuild it with an appropriate Depends entry (version of R > greater than 3) in the DESCRIPT

[R] Retrieve Axis coordinates from map

2014-07-24 Thread Julien Million
Hi, i want to automatise the creation of some maps with R, however, I would need to be able to retrieve the coordinates of the axes that R is automatically generated. When using the package MAPS, and creating a map, R will automatically adjust the plot to the region that you are plotting. for

[R] working on a data frame

2014-07-24 Thread Matthew
I am coming from the perspective of Excel and VBA scripts, but I would like to do the following in R. I have a data frame with 14 columns and 32,795 rows. I want to check the value in column 8 (row 1) to see if it is a 0. If it is not a zero, proceed to the next row and check the value for co

Re: [R] R-3.1.1 - R CMD INSTALL problem

2014-07-24 Thread Jeff Newmiller
You need to rebuild it with an appropriate Depends entry (version of R greater than 3) in the DESCRIPTION file. Further discussion about how to fix packages belongs on the R-devel mailing list. --- Jeff Newmiller

[R] R-3.1.1 - R CMD INSTALL problem

2014-07-24 Thread Eduardo M. A. M.Mendes
Hello I have recently upgraded R to the newest version. Unfortunately my old (fortran and C) R-package cannot be installed anymore (was built before R 3.0.0: please re-install it). I have tried R CMD INSTALL package_name but I noticed that R requests gcc-4.8.2 and specific locations for the

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Peter Alspach
Tena koe Steven R is case-sensitive. FUN is missing (you have supplied fun - and × and margin) ... HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pfeiffer, Steven Sent: Friday, 25 July 2014 5:08 a.m. To:

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Pfeiffer, Steven
Ugghh... Sorry for bothering you all!! (Yes, I analyzed the data for my ecology M.S. project with R, but I wasted countless hours committing silly mistakes like this.) On Thu, Jul 24, 2014 at 4:11 PM, Bert Gunter wrote: > ummm R is case sensitive! "fun" != "FUN" > > (Have you gone throug

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Bert Gunter
ummm R is case sensitive! "fun" != "FUN" (Have you gone through any R tutorials yet? If not, please do so before posting further). Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly n

Re: [R] R CMD BATCH *without* saving output

2014-07-24 Thread Henrik Bengtsson
On *nix like systems: Rscript myscript.R > /dev/null 2>&1 On Windows: Rscript myscript.R > NUL 2>&1 The above sends both standard output ("1") and standard error ("2") to nirvana. I prefer using 'Rscript', but the same works with any command including 'R CMD BATCH'. /Henrik PS. Bill, capture.o

[R] Kernel smoothing density function

2014-07-24 Thread Ferra Xu
Hello all, In order to find the kernel smoothing density function of a 3 dimensional data-set, I wrote this code in R: library(ks)defect <-read.table(file.choose(),sep=",")hat <-kde(defect)pdf("SampleGraph.pdf")plot(hat,drawpoints=TRUE)dev.off() But I have problem in interpretation of the result.

[R] Using apply() with functions I wrote

2014-07-24 Thread Pfeiffer, Steven
Hello! Does apply() not work with customized functions? Here is a simple example: AddSeven<-function(n){n+7} AddSeven(3) [1] 10 M<-matrix(nrow=2,ncol=2,data=c(1,2,3,4),byrow=TRUE) M [,1] [,2] [1,]12 [2,]34 apply(x=M,margin

Re: [R] Technological/Logistic Substitution Model

2014-07-24 Thread Peter Maclean
Any one with an idea of estimating the Technological/Logistic substitution model. The model is specified as: fi(t(j)) = 1/[1-exp(-alpa(t(i))-beta(i)]    for t 0 fi(t(j)) = 1-sum(f(j-1))- sum(f(j+1))   for tb <=t <= tc fi(t(j)) = 1/[1+ exp(alpas(t(i)-betas(i))]  for t >=tc and alphas >0.   The

[R] R CMD BATCH *without* saving output

2014-07-24 Thread Nick Matzke
Hi all, Hi have a series of scripts that print a lot of notes etc. to screen. I have to run them on a massive set of input files. The scripts are self-contained and save the important output to data files in an organized way. I don't need the screen output for anything. Problems: - If I run th

Re: [R] R CMD BATCH *without* saving output

2014-07-24 Thread William Dunlap
You also might try wrapping the call to the scripts with capture.output(). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jul 24, 2014 at 9:54 AM, Nick Matzke wrote: > Actually, this was the full solution: > > At the beginning of the script: > > # Suppressing all output/warnings/try errors

Re: [R] R CMD BATCH *without* saving output

2014-07-24 Thread Nick Matzke
Actually, this was the full solution: At the beginning of the script: # Suppressing all output/warnings/try errors: # Open connection to black hole con=file(open="/dev/null") # Don't print anything to screen sink(file=con, type="output") # Don't print messages (e.g. errors/warnings) sink(file=con

Re: [R] R CMD BATCH *without* saving output

2014-07-24 Thread Nick Matzke
On Thu, Jul 24, 2014 at 12:16 PM, Nick Matzke wrote: > Hi all, > > Hi have a series of scripts that print a lot of notes etc. to screen. I > have to run them on a massive set of input files. The scripts are > self-contained and save the important output to data files in an organized > way. I do

Re: [R] Creating Functions in R

2014-07-24 Thread Sarah Goslee
Hi, On Thu, Jul 24, 2014 at 11:08 AM, Pavneet Arora wrote: > Hello Sarah > > Thank you the detailed explanation, it helped me understand a lot. However, > I don't understand what you meant by - " It's a really good idea to > explicitly mark the loop with { } too, to reduce confusion." Instead of

Re: [R] Cairo package error: "unable to load..."

2014-07-24 Thread Simon Urbanek
On Jul 24, 2014, at 12:03 PM, Leonardo Gama wrote: > Sorry, Simon. I should have suspected that it was a trivial problem. But > there was an X11 app icon in Applications and I assumed it was installed, but > was not. This mensgem only appeared when I clicked on such icon: > > > Yes, as you

Re: [R] Windows R doesn't recognize shortcuts ?

2014-07-24 Thread Keith Jewell
On 23/07/2014 14:21, Duncan Murdoch wrote: On 23/07/2014 9:08 AM, ce wrote: Hi All, In Windows 7 , R installation: R version 3.1.1 Patched (2014-07-14 r66149) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) it doesn't

Re: [R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
Hello Sarah Thank you the detailed explanation, it helped me understand a lot. However, I don't understand what you meant by - " It's a really good idea to explicitly mark the loop with { } too, to reduce confusion." Also as per your suggestion I tried to say sub$value, but i get the same value

Re: [R] A question about call()

2014-07-24 Thread super
Thanks a lot, it is much clear to me now, but i still have a question:The raw question is from:Hadley wickham's book advanced r programming, Chapter Meta programming, section expressions, in the part "Creating a call from its components"He said:To create a new call from its components, you ca

Re: [R] Creating Functions in R

2014-07-24 Thread jim holtman
Modified your function and also you don't need a function to do this: sub <- structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), value = c(9.45, 7.99, 9.29, 11.66, 12.16, 10.18, 8.04, 11.46, 9.2, 10.34, 9.03, 11.47

Re: [R] Creating Functions in R

2014-07-24 Thread David L Carlson
Before you start writing functions, you should learn the basics of R by reading "An Introduction to R" (http://cran.r-project.org/doc/manuals/r-release/R-intro.pdf). Pages 7 and 8 cover what you are asking. There is no need for a for() loop at all and your function is simply overwriting the val

Re: [R] Creating Functions in R

2014-07-24 Thread Sarah Goslee
Hi, On Thu, Jul 24, 2014 at 9:35 AM, Pavneet Arora wrote: > Hello Guys > I am new at writing Functions in R, and as a result am struggling with it. > I am trying to use Google & other resources, but it's hard to find > solutions when you don't know what to look for. How about the introduction t

Re: [R] Cairo package error: "unable to load..."

2014-07-24 Thread Simon Urbanek
Leonardo, you don't have X11 installed and it no longer ships with OS X 10.9 - you need to get it from http://xquartz.macosforge.org Cheers, Simon On Jul 23, 2014, at 9:25 PM, Leonardo Gama wrote: > Hi! > > I've just installed R on my OS X 10.9 and was trying to make > arrayQualityMetrics

[R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
Hello Guys I am new at writing Functions in R, and as a result am struggling with it. I am trying to use Google & other resources, but it's hard to find solutions when you don't know what to look for. I have the following small dataset > dput(sub) structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8,

Re: [R] A question about call()

2014-07-24 Thread Duncan Murdoch
On 24/07/2014, 2:41 AM, super wrote: > The question is as below: > Exercises > 1.The following two calls look the same, but are actually different: > (a <- call("mean", 1:10)) > #> mean(1:10) This one creates a call where the first argument is a vector containing 10 elements. > (b <- call("mean

Re: [R] Fast function for each row of a data.table

2014-07-24 Thread PIKAL Petr
Hi If your problem is not bigger than example (regarding columns following maybe can help (I shortened target.column to tc) dt$target.value <- dt[,3]*(dt$tc==3)+dt[,2]*(dt$tc==2)+dt[,1]*(dt$tc==1) and changed dt to data frame as I do not use data table. But it shall work with data table too.

[R] MCMCglmm question

2014-07-24 Thread Martina Carrete
Hi list members, I'm doing some analysis about differences in behaviours between rural and urban birds and, after reading and searching in different sources, I have a lot of doubts about how I'm performing them. I would greatly appreciate any feedback from you. Here are my questions, models a

Re: [R] A question about call()

2014-07-24 Thread Jeff Newmiller
Please read the Posting Guide. There is a no HTML policy and a no homework policy. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...