Re: [R] Extract data from .nc file

2021-03-09 Thread Rasmus Liland
Dear Shailendra and Roy, Yes, the info ncvar_get retrieves is of different lengths. soi_final does not have a time variable for the x axis, and tt is a integer vector int [1:2001(1d)] 0 365 730 1095 1460 1825 2190 2555 2920 3285 ... The file is a HDF5 file: rasmus@twosixty ~ % file

Re: [R] Extract data from .nc file

2021-02-24 Thread Roy Mendelssohn - NOAA Federal via R-help
Hi Shailendra: You didn't provide the error messages you received, which makes it difficult to answer. I will say here is at least one typo, in: > write.csv(amo_final, "soi.csv", row.names = FALSE) You have only defined "soi_final". But I would also be surprised if either of the "cbind()" o

Re: [R] Extract data of special character

2019-03-15 Thread Rui Barradas
Hello, Something like this? old_par <- par(mar = par("mar") + c(5, 0, -2, 0)) boxplot(SCORE ~ ATTRIBUTE, dd, cex.axis = 0.6, las = 2) par(old_par) Hope this helps, Rui Barradas Às 00:06 de 15/03/2019, roslinazairimah zakaria escreveu: Hi Rui and Ivan, Yes both works well. table(dd$ATTRIBU

Re: [R] Extract data of special character

2019-03-15 Thread Ivan Krylov
В Fri, 15 Mar 2019 08:06:52 +0800 roslinazairimah zakaria пишет: > I want to draw boxplot for each individual score of the > attributes. You mean, a box per every possible ATTRIBUTE value? This is easily doable with the bwplot() function from library(lattice). -- Best regards, Ivan __

Re: [R] Extract data of special character

2019-03-14 Thread roslinazairimah zakaria
Hi Rui and Ivan, Yes both works well. table(dd$ATTRIBUTE, dd$TRAIT) #or xtabs( ~ ATTRIBUTE + TRAIT, dd) I have another question,I also want to extract all the PCT_SCORE to draw box plot. I have tried to draw box of PCT_SCORE for all attribute scores. boxplot(dd$PCT_SCORE, ylim=c(0,100),

Re: [R] Extract data of special character

2019-03-14 Thread roslinazairimah zakaria
Yes, it does. table(dd$ATTRIBUTE, dd$TRAIT) #or xtabs( ~ ATTRIBUTE + TRAIT, dd) Thank you so much Rui and Ivan. On Fri, Mar 15, 2019 at 5:51 AM Rui Barradas wrote: > Hello, > > Or more simple, > > xtabs( ~ ATTRIBUTE + TRAIT, dd) > > > Hope this helps, > > Rui Barradas > > Às 19:27 de 14/03/201

Re: [R] Extract data of special character

2019-03-14 Thread Rui Barradas
Hello, Or more simple, xtabs( ~ ATTRIBUTE + TRAIT, dd) Hope this helps, Rui Barradas Às 19:27 de 14/03/2019, Ivan Krylov escreveu: On Fri, 15 Mar 2019 03:06:28 +0800 roslinazairimah zakaria wrote: how many of ATTRIBUTE related to TRAITS. The table() function can be used to count occurr

Re: [R] Extract data of special character

2019-03-14 Thread Ivan Krylov
On Fri, 15 Mar 2019 03:06:28 +0800 roslinazairimah zakaria wrote: > how many of ATTRIBUTE related to TRAITS. The table() function can be used to count occurrences of each combination of factor levels. Does extracting the two columns by dd[,c('ATTRIBUTE','TRAIT')] and passing the result to table(

Re: [R] Extract data

2016-07-30 Thread roslinazairimah zakaria
Thank you so much Jim. Here is the code. sum_balok <- as.vector(by(dt1$x,dt1$year,sum,na.rm=TRUE)) sum_gambang <- as.vector(by(dt2$x,dt2$year,sum,na.rm=TRUE)) sum_sgsoi <- as.vector(by(dt3$x,dt3$year,sum,na.rm=TRUE)) sum_jpsphg <- as.vector(by(dt4$x,dt4$year,sum,na.rm=TRUE)) sum_pbesar <- a

Re: [R] Extract data

2016-07-29 Thread Jim Lemon
Hi Roslina, This may be what you want: sum_balok<- as.vector(by(aggbalok_2009_2014$x,aggbalok_2009_2014$year,sum,na.rm=TRUE)) cbind(year=2009:2014,sum_balok) I don't have the data for the other measures, but you could calculate the sums as you did below and then add them to the cbind arguments.

Re: [R] Extract data

2016-07-28 Thread roslinazairimah zakaria
Thank you very much Jim. It works beautifully. Best regards, On Fri, Jul 29, 2016 at 11:56 AM, Jim Lemon wrote: > Hi Roslina, > Try this: > > aggbalok_mth[aggbalok_mth$year %in% 2009:2014,] > > Jim > > > On Fri, Jul 29, 2016 at 1:12 PM, roslinazairimah zakaria > wrote: > > Dear r-users, >

Re: [R] Extract data

2016-07-28 Thread Jim Lemon
Hi Roslina, Try this: aggbalok_mth[aggbalok_mth$year %in% 2009:2014,] Jim On Fri, Jul 29, 2016 at 1:12 PM, roslinazairimah zakaria wrote: > Dear r-users, > > I would like to extract year from 2009 to 2014 with the corresponding month > and rain amount. > > I tried this: > aggbalok_mth[aggbalo

Re: [R] Extract data from Array to Table

2015-02-12 Thread Sven E. Templer
Make use of the plyr and reshape2 package (both on CRAN): library(plyr) d<-adply(ArrayDiseaseCor, 1:2) # adply calls function identity by default d<-melt(d) d<-subset(d,value>.5) head(d) You will have to rename columns, or adjust arguments in melt/adply. Note: use set.seed before sampling for rep

Re: [R] Extract data from Array to Table

2015-02-12 Thread Sven E. Templer
see inline On 12 February 2015 at 09:10, Sven E. Templer wrote: > Make use of the plyr and reshape2 package (both on CRAN): > I forgot: library(reshape2) > library(plyr) > d<-adply(ArrayDiseaseCor, 1:2) > # adply calls function identity by default > d<-melt(d) > d<-subset(d,value>.5) > head(d)

Re: [R] Extract Data form Website Tables

2014-03-22 Thread Jennifer Young
Hi Doran I'm also trying to scrape the leaderboard data. Did you happen to figure out how to extract the athlete's team/affiliate? Trying to do a bit of code to figure out which teams will qualify when individuals are removed. On Sunday, March 2, 2014 2:34:21 PM UTC-5, Doran, Harold wrote: > >

Re: [R] Extract Data form Website Tables

2014-03-02 Thread Doran, Harold
This is fantastic, thank you. I¹ve modified the code to loop through all the pages and grab all rows of the HTML table. Thank you, Rui. On 3/2/14, 5:08 AM, "Rui Barradas" wrote: >Hello, > >Maybe something like the following. > >#install.packages("XML", dep = TRUE) > >library(XML) > >url <- >

Re: [R] Extract Data form Website Tables

2014-03-02 Thread Rui Barradas
Hello, Maybe something like the following. #install.packages("XML", dep = TRUE) library(XML) url <- "http://games.crossfit.com/scores/leaderboard.php?stage=1&sort=0&division=1®ion=0&numberperpage=60&page=0&competition=0&frontpage=0&expanded=0&full=1&year=14&showtoggles=0&hidedropdowns=0&showa

Re: [R] Extract data in word pad

2013-01-12 Thread David Winsemius
Note: I usually reply to posters as well as the list, but after having my email address sent to this poster forwarded to a spamming photo site which refuses to honor its unsubscribe links, I am deleting her address from the response. On Jan 12, 2013, at 6:23 PM, Roslina Zakaria wrote:

Re: [R] Extract data

2013-01-11 Thread John Kane
Hi, welcome to the R-help list This help list does not accept html coded messages and so nothing meaningful seems to have come through. If you aready have the data loaded into R please supply some sample data The easiest way to supply data is to use the dput() function. Example with your

Re: [R] Extract data

2013-01-11 Thread PIKAL Petr
Hi No HTML. No highlighting. if you want some data from object use extraction operator ?"[" Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of shairul samat > Sent: Friday, January 11, 2013 10:19 AM > To: r-help@r-proje

Re: [R] extract data from square cracket

2012-05-16 Thread Marc Girondot
Le 17/05/12 03:37, Min Wang a écrit : Dear Sir or Madam, I have a question like this. I want to extract the following data from the square bracket: 1 bandband[0.86] 2 bandband[0.93] 3 noband noban

Re: [R] extract data

2012-04-04 Thread Rui Barradas
Hello, Roslina Zakaria wrote > > HI, > > > > I would like to extract data in a specific way.  For example, the rainfall > data > > > > 0,0,1.5,0,0, 3,1,2.5,0,0,0,0, 2.3,0,0,0, 2.1,1.4,0,0,0, 3,2,1,0,0,0... > > > > data_1: 1.5, 2.3   ( a single nonzero data between zeros data

Re: [R] Extract Data from Yahoo Finance

2011-11-04 Thread Joshua Ulrich
eb > From: Joshua Ulrich > To: Deb Midya > Cc: R. Michael Weylandt ; "r-help@r-project.org" > > Sent: Friday, 4 November 2011 4:12 PM > Subject: Re: [R] Extract Data from Yahoo Finance > > Deb, > > See getQuote in the quantmod package.  For example: > ge

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Joshua Ulrich
t; > Deb > > From: R. Michael Weylandt > To: Deb Midya > Cc: "r-help@r-project.org" > Sent: Friday, 4 November 2011 12:13 AM > Subject: Re: [R] Extract Data from Yahoo Finance > > The quantmod package can probably do what you are asking, but it's a > l

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Deb Midya
you have given.   Regards,   Deb From: R. Michael Weylandt To: Deb Midya Cc: "r-help@r-project.org" Sent: Friday, 4 November 2011 12:13 AM Subject: Re: [R] Extract Data from Yahoo Finance The quantmod package can probably do what you are asking, but it's a little hard to be ce

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Deb Midya
Ask, Bid, ..., Stock Exchange?   Once again, thank you very much for the time you have given.   Regards,   Deb   From: Vikram Bahure Sent: Thursday, 3 November 2011 7:15 PM Subject: Re: [R] Extract Data from Yahoo Finance Hi, You can install the following librar

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread R. Michael Weylandt
The quantmod package can probably do what you are asking, but it's a little hard to be certain since you provide neither a list of all the fields you are actually talking about nor a link to the page with the fields in question. Michael On Thu, Nov 3, 2011 at 12:02 AM, Deb Midya wrote: > Hi R –u

Re: [R] extract data for specific levels factor

2011-10-26 Thread Andrés Aragón
Dear all, Thanks for your help. Option of Sarah and Dan is just what I want: ff1<-mydata[mydata$cat%in%c(“wish1”, “wish2”, “wish3”),] Then I used ff1 in ggplot2 without problems. Option of Dennis (reshape2) does produced an output “no coherent”: content in he object contained data of categorical

Re: [R] extract data for specific levels factor

2011-10-25 Thread Dennis Murphy
Are you trying to separate the substrings in cat? If so, one way is to use the colsplit() function in the reshape2 package, something like (untested since you did not provide a suitable data format with which to work): library('reshape2') splitcat <- colsplit(mydata$cat, ' ', names = c('fat', 'bat

Re: [R] extract data for specific levels factor

2011-10-25 Thread Sarah Goslee
ón >> Cc: R-help@r-project.org >> Subject: Re: [R] extract data for specific levels factor >> >> Hi, >> >> 2011/10/25 Andrés Aragón : >> > Dear all, >> > >> > I'm trying to analyze data with the following structure: >> > >&

Re: [R] extract data for specific levels factor

2011-10-25 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Sarah Goslee > Sent: Tuesday, October 25, 2011 12:50 PM > To: Andrés Aragón > Cc: R-help@r-project.org > Subject: Re: [R] extract data for specific

Re: [R] extract data for specific levels factor

2011-10-25 Thread Sarah Goslee
Hi, 2011/10/25 Andrés Aragón : > Dear all, > > I'm trying to analyze data with the following structure: > > ind          cat            tx      age > 40.2 por fol peq     vh        35 > 41.9 por fol med     vh        35 > 68.9 por fol preov   vh       35 > 71.5 por fol peq      ser       37 > 67.5

Re: [R] extract data from a column

2011-06-19 Thread Nanami
I figured it out: x<-sub("^.*:([[:digit:]]+)..([[:digit:]]+).*", "\\1 \\2", CTSS$V4) -- View this message in context: http://r.789695.n4.nabble.com/extract-data-from-a-column-tp3609890p3610147.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] extract data from a column

2011-06-19 Thread Nanami
So if I am given some data that look like this: > head(CTSS) V1 V2 V3V4 V5 V6 V7 1 chr1 564563 564598 chr1:564588..564589,+ 1336 2 chr1 564620 564649 chr1:564644..564645,+ 94 3 chr1 565369 565404 chr1:565371..565372,+ 217 4 chr1 565463 5655

Re: [R] extract data from a column

2011-06-19 Thread Sam Albers
If I understand what you want (which I may very well not) you could use something like this: If this is an example of your type of data: 564589,+ substr(x, 1, 6) as.numeric(x) Please try to post something more thorough if you would like a better answer. Sam -- View this message in context: ht

Re: [R] extract data features from subsets

2011-06-06 Thread Dennis Murphy
Hi: Here's one way using package plyr and its ddply() function. ddply() takes a data frame as input and expects to output either a scalar or a data frame. In this case, we want the latter. library(plyr) f <- function(df) { mn <- min(df$result) tms <- df$time[df$result == mn] subdf <-

Re: [R] extract data from a data frame field

2011-06-06 Thread jim holtman
Here is a start; you can change the column names: > x chr startend peak_loc cluster_TC strand peak_TC 1 chr1 564620 564649 chr1:564644..564645,+ 94 + 10 2 chr1 565369 565404 chr1:565371..565372,+217 + 8 3 chr1 565463 565541 chr1:565480..565

Re: [R] Extract data

2011-01-06 Thread jim holtman
'merge' comes in handy: > spec <- read.table(textConnection("Species 1 2 3 + a t y h + b f j u + c r y u"), header=TRUE) > comm <- read.table(textConnection("community sp

Re: [R] Extract data

2011-01-06 Thread Chris Mcowen
Dear David, Thats great, thanks very much for the help, much appreciated. On 6 Jan 2011, at 15:53, David Winsemius wrote: On Jan 6, 2011, at 6:36 AM, Chris Mcowen wrote: > Dear List, > > I have a data frame called trait with roughly 800 species in, each species > have 15 columns of informat

Re: [R] Extract data

2011-01-06 Thread David Winsemius
On Jan 6, 2011, at 6:36 AM, Chris Mcowen wrote: Dear List, I have a data frame called trait with roughly 800 species in, each species have 15 columns of information: Species 1 2 3 etc.. a t y h b f j

Re: [R] Extract data from tseries stl function

2009-10-14 Thread David Winsemius
On Oct 14, 2009, at 5:05 PM, nmo wrote: I have generated a table using the stl function from tseries. How? How can I extract (other than manual copy) Huh? data from a column (eg trend) First you look at the structure of the object. In my case, since you did not provide a worked ex

Re: [R] extract data from shapefiles

2009-08-14 Thread Barry Rowlingson
On Fri, Aug 14, 2009 at 9:11 PM, Kate Zinszer wrote: > I'm hoping that someone could guide me in how to extract data from > shapefiles.  I want to extract data from a shapefile (classed as > "SpatialPolygonsDataFrame") and more specifically, the data is contained > within the slot called "coords

Re: [R] Extract Data from a Webpage

2008-12-16 Thread Duncan Temple Lang
Hi Chuck. Well, here is one way theURL = "http://oasasapps.oasas.state.ny.us/portal/pls/portal/oasasrep.providersearch.take_to_rpt?P1=3489&P2=11490"; doc = htmlParse(theURL, useInternalNodes = TRUE, error = function(...) {}) # discard any error messages # Find the nodes