Re: [R] regex - extracting src url

2016-03-21 Thread Bert Gunter
?strsplit #I think My "solution" assumes a fixed format for the URL's as shown in your example. If that is not the case, it doesn't work. > y <- '

Re: [R] get values out of combined object

2016-03-21 Thread Ragia .
many thanks...it solved my problem...and I will review what is factors..( I think I have misunderstanding in this) RagiA   > From: macque...@llnl.gov > To: ragi...@hotmail.com; r-help@r-project.org > Subject: Re: [R] get values out of combined object >

[R] regex - extracting src url

2016-03-21 Thread Omar André Gonzáles Díaz
Hi,I have a DF with a column with "html", like this: https://ad.doubleclick.net/ddm/trackimp/N344006.1960500FACEBOOKAD/B9589414.130145906;dc_trk_aid=303019819;dc_trk_cid=69763238;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?; BORDER="0" HEIGHT="1" WIDTH="1"

Re: [R] installing packages

2016-03-21 Thread Jeff Newmiller
I hope not. That directory is not for working in. suggestion to restart R sounds most likely to fix the issue. -- Sent from my phone. Please excuse my brevity. On March 21, 2016 2:10:01 PM PDT, KMNanus wrote: >Have you set your working directory to the “3.2” folder? >Ken

Re: [R] installing packages

2016-03-21 Thread KMNanus
Have you set your working directory to the “3.2” folder? Ken kmna...@gmail.com 914-450-0816 (tel) 347-730-4813 (fax) > On Mar 21, 2016, at 5:07 PM, James Henson wrote: > > Dear R community, > > When I install or update a package, R prints the waring below. I go to the >

[R] GPIB-compatible instrument control with R

2016-03-21 Thread Martin Seilmayer
Hi, I know this comes late but it should be mentioned. Since Jan 2016 there is a package "serial" on CRAN, which provides an interface to the serial RS232 RS485 RS422 com ports within R. Best Martin __ R-help@r-project.org mailing list -- To

Re: [R] installing packages

2016-03-21 Thread John Kane
Can you load the downloaded library? If so I'd not worry about it. John Kane Kingston ON Canada > -Original Message- > From: jfhens...@gmail.com > Sent: Mon, 21 Mar 2016 16:07:41 -0500 > To: r-help@r-project.org > Subject: [R] installing packages > > Dear R community, > > When I

Re: [R] how to use vectorization instead of for loop

2016-03-21 Thread Dalthorp, Daniel
or simpler and faster: dat[,4] <- sign(dat[,2])/dat[,3] # your original loop dat <- cbind(dat, dat[,2] == Inf) # append a new column with indicator for which rows have dat[,2] = Inf On Mon, Mar 21, 2016 at 2:45 PM, wrote: > Hello, > > Use combined ifelses, more or less

Re: [R] installing packages

2016-03-21 Thread Uwe Ligges
On 21.03.2016 22:07, James Henson wrote: Dear R community, When I install or update a package, R prints the waring below. I go to the ‘downloaded_packages’ folder in the Temp file and manually move the new or updated package to the folder ‘3.2’. How can I instruct R to download new and

Re: [R] how to use vectorization instead of for loop

2016-03-21 Thread ruipbarradas
Hello, Use combined ifelses, more or less like the following. ifelse(dat[, 2] == Inf, do this, ifelse(dat[, 2] > 0, 1 * (1/dat[,3]), -1* (1/dat[,3]))) Rui Barradas   Citando Stephen HK WONG : > So much thanks Rui, the code can be so simple and fast. > > By the way,

[R] installing packages

2016-03-21 Thread James Henson
Dear R community, When I install or update a package, R prints the waring below. I go to the ‘downloaded_packages’ folder in the Temp file and manually move the new or updated package to the folder ‘3.2’. How can I instruct R to download new and updates packages into the ‘3.2’ folder? Warning

Re: [R] get values out of combined object

2016-03-21 Thread MacQueen, Don
Here, by example, might be what you're looking for: > v <- c(a=1, b=3, c=25) > v a b c 1 3 25 > unname(v) [1] 1 3 25 However, this has nothing to do with factors, and don't know what you mean by the "factor numeric values" of an object that isn't a factor. -- Don MacQueen Lawrence

Re: [R] how to use vectorization instead of for loop

2016-03-21 Thread Stephen HK WONG
So much thanks Rui, the code can be so simple and fast. By the way, ifelse is good for two conditions, in my case, either >0, or <0, I found there's a lot of row with value "Inf", I want to keep it in new column, how do I do that using ifelse ? Thanks.

[R] get values out of Structure

2016-03-21 Thread Ragia .
 accept my apology for resending..   Dear group  I have the following variable v_neighbours and it holds a vector of the following :   gawker.com gle.am jezebel.com   1 16 28 to have a copy,   dput(v_neighbours) structure(c(1L, 16L, 28L), .Names = c("gawker.com", "gle.am", "jezebel.com"))  

[R] how to use vectorization instead of for loop

2016-03-21 Thread Stephen HK WONG
Dear All, I have a dataframe like below but with many thousands rows, structure(list(gene_id = structure(1:6, .Label = c("0610005C13Rik", "0610007P14Rik", "0610009B22Rik", "0610009L18Rik", "0610009O20Rik", "0610010B08Rik,OTTMUSG0016609"), class = "factor"), log2.fold_change. = c(0.0114463,

Re: [R] possible to use the program for commercial reasons?

2016-03-21 Thread Marc Schwartz
> On Mar 21, 2016, at 6:44 AM, Felix Töpfer wrote: > > Dear R-Team, > > I am a scientist actually working in parallel as data analyst for an > advertisment auditing company. Therefore i would use your software for > commercial reasons right now. Is this allowed, o rare

Re: [R] Reshaping an array - how does it work in R

2016-03-21 Thread Roy Mendelssohn - NOAA Federal
Thanks for the info, but I will stay with regular R. Work -arounds for what I want to do just took some thought and programming, I just didn’t know if R copied the array or just manipulated indices, and given the size of the array I am memory limited. This gets into the old thing of

[R] possible to use the program for commercial reasons?

2016-03-21 Thread Felix Töpfer
Dear R-Team, I am a scientist actually working in parallel as data analyst for an advertisment auditing company. Therefore i would use your software for commercial reasons right now. Is this allowed, o rare there special licences? Best Regards, Felix T�pfer B�roassistenz

[R] Reshaping an array - how does it work in R

2016-03-21 Thread Rodrigo Botafogo
Roy, I have implemented a Ruby Gem (SciCom) with exactly your use case in mind. SciCom is based on Renjin, an R interpreter for the JVM. So, this reply is about R, but not about GnuR. If this is not proper behavior, please let me know. I´ve looked at the posting guidelines and it seems to be

Re: [R] how to use vectorization instead of for loop

2016-03-21 Thread ruipbarradas
Hello, I've renamed your dataframe to 'dat'. Since ?ifelse is vectorized, try dat[, 4] <- ifelse(dat[, 2] > 0, 1 * (1/dat[,3]), -1* (1/dat[,3])) Oh, and why do you multiply by 1 and by -1? It would simply be 1/dat[,3] and -1/dat[,3]. Hope this helps, Rui Barradas Quoting Stephen HK WONG

Re: [R] Help! Mann whitney

2016-03-21 Thread KMNanus
Here’s how I did it - Save the xlsx file as a .csv. Then call read.csv(“your file.csv”) and you should be in. Ken kmna...@gmail.com 914-450-0816 (tel) 347-730-4813 (fax) > On Mar 20, 2016, at 1:37 PM, > wrote: > > This may be really basic,

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread Paul Murrell
Hi If Xsplines give you the shape you want, then you can retrieve points on the boundary of the shape using xsplinePoints(). For example ... shapepoints <- structure(list(x = c(8.9, 0, -7.7, 0, 8.9), y = c(0, 2, 0, -3.8, 0)), .Names =

Re: [R] get values out of combined object

2016-03-21 Thread ruipbarradas
Hello, Apparently your v_neighbours is a named vector of integers, so v_neighbours[1:3] or just v_neighbours will do the job(!) Hope this helps, Rui Barradas Quoting "Ragia ." :    Dear group I have the following variable   v_neighbours and it holds a vector of

[R] get values out of combined object

2016-03-21 Thread Ragia .
   Dear group I have the following variable   v_neighbours and it holds a vector of the following :  gawker.com      gle.am   jezebel.com            1          16          28  three urls and their id ...when I call the class(v_neighbours )  the result is   "integer" how can I get the factor

[R] survROC, interval censoring?

2016-03-21 Thread Markian Pahuta
Hello, I would like to generate an ROC curve for cumulative cases. However, my data are interval censored. I know the risksetROC package handles interval censored data. However, I am interested in cumulative disease... consequently I believe the survivalROC package may be more appropriate. In

Re: [R] Persistent state in a function?

2016-03-21 Thread Bert Gunter
Yes, Duncan. My statement was wrong. I should have said that it's the environment/evaluation frame of f = g(). Thank you for the correction. Still, I hope my example was helpful. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread Thierry Onkelinx
Dear Allie, You could use elliptic fourier analysis shapepoints = structure(list(x = c(8.9, 0, -7.7, 0, 8.9), y = c(0, 2, 0, -3.8, 0)), .Names = c("x", "y"), row.names = c(NA, -5L), class = "data.frame") shapepoints$Theta <- seq(0, 2 * pi, length = nrow(shapepoints)) model <- lm(cbind(x, y) ~

Re: [R] Persistent state in a function?

2016-03-21 Thread Duncan Murdoch
On 21/03/2016 11:19 AM, Bert Gunter wrote: Martin, All: A very nice point! Perhaps the following may help to illustrate it. g <- function(){ x <- NULL function(y){cat("result is ",x," \n"); x <<- y} } > f <- g() > rm(g) # g is deleted but its environment remains as the environment of

Re: [R] Persistent state in a function?

2016-03-21 Thread Bert Gunter
Martin, All: A very nice point! Perhaps the following may help to illustrate it. g <- function(){ x <- NULL function(y){cat("result is ",x," \n"); x <<- y} } > f <- g() > rm(g) # g is deleted but its environment remains as the environment of f > f(1) result is > f(3) result is 1 >

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread S Ellison
Is there a reason not to use the convex hull for area calculations? Any curve you put through the points would surely be at least as arbitrary as a straight line. S Ellison > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alexander > Shenkin >

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread Alexander Shenkin
Thanks for your reply, Charles. spline() doesn't seem to fit a closed shape; rather, it's producing a parabola. Perhaps I'm missing an argument I should include? grid.xspline() seems to get close to what I need, but it returns a grob object - not sure how to work with those as shapes per

Re: [R] Please guide -- Error during export in csv format

2016-03-21 Thread Duncan Murdoch
On 21/03/2016 7:53 AM, Sunny Singha wrote: Please guide, I'm exporting data in '.csv' format in the Windows user directory, I have full access to. The write operation happens within a for loop. Each iteration exports data in csv format in the user directory. The issue is that the data gets

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread Charles Determan
Hi Allie, What is you goal here? Do you just want to plot a curve to the data? Do you want a function to approximate the data? You may find the functions spline() and splinefun() useful. Quick point though, with so few points you are only going to get a very rough approximation no matter the

Re: [R] Please guide -- Error during export in csv format

2016-03-21 Thread Sunny Singha
(Re-posting after including R-help) Thanks Ben, Changing './' and '.' and shQuote() didn't work. I'm trying dQuote(). For your information the 'name' value retrieved is --> Hội những người đồng hành cùng I guess the string is in Vietnamese language. As you would have observed in error message it

[R] Fit a smooth closed shape through 4 points

2016-03-21 Thread Alexander Shenkin
Hello all, I have sets of 4 x/y points through which I would like to fit closed, smoothed shapes that go through those 4 points exactly. smooth.spline doesn't like my data, since there are only 3 unique x points, and even then, i'm not sure smooth.spline likes making closed shapes. Might

Re: [R] Please guide -- Error during export in csv format

2016-03-21 Thread Ben Tupper
Hi, You are defeating the purpose of the file.path() function by providing a path separator in the first argument; you used './', but try instead... my.file1 <- file.path('.', paste0('likes','_',name,'_',grp_id,'.csv')) Also, there appear to be spaces in the 'name' argument - that might be

[R] Please guide -- Error during export in csv format

2016-03-21 Thread Sunny Singha
Please guide, I'm exporting data in '.csv' format in the Windows user directory, I have full access to. The write operation happens within a for loop. Each iteration exports data in csv format in the user directory. The issue is that the data gets exported for all the 9 iterations but fails for

[R] [R-pkgs] acs version 2.0: an R package to download and analyze data from the US Census

2016-03-21 Thread Ezra Haber Glenn
We are pleased to announce the release of version 2.0 of the "acs" package, now available on CRAN . The package allows users to download, manipulate, analyze, and present demographic data from the U.S. Census, with special tools and methods

Re: [R] Persistent state in a function?

2016-03-21 Thread Martin Maechler
> Duncan Murdoch > on Sat, 19 Mar 2016 17:57:56 -0400 writes: > On 19/03/2016 12:45 PM, Boris Steipe wrote: >> Dear all - >> >> I need to have a function maintain a persistent lookup table of results for an expensive calculation, a named