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

[R] Extract data from .nc file

2021-02-24 Thread Shailendra Pratap
Hi, Please help me. I am trying to get information on "soi" from the NetCDF file (please see the attached). The file is showing this info- float soi(time=2001, *MCrun=20, members=100*); :description = "soi"; :long_name = "Southern Oscillation Index"; :units = ""; :level = "sfc"; And Dime

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(

[R] Extract data of special character

2019-03-14 Thread roslinazairimah zakaria
Hi r-users, I have these data and I would like to count (frequency) how many of ATTRIBUTE related to TRAITS. > dput(dd) structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4

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

[R] Extract data

2016-07-28 Thread roslinazairimah zakaria
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[aggbalok_mth$year == 2009:2014, ] but some of the data is missing. > dput(aggbalok_mth[aggbalok_mth$year == 2009:2014, ] ) structure(list(month = c(1, 7, 2, 8, 3

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)

[R] Extract data from Array to Table

2015-02-11 Thread Karim Mezhoud
Dear All, I am facing the task to extract data from array to table. here an example of array. ##Get A list of Matrices with unequal rows Disease <- NULL Diseases <- NULL ListMatByGene <- NULL for(i in 1:3){ Disease[[i]] <-matrix(sample(-30:30,25+(5* i)),5+i) rownames(Disease[[i]]) <- paste0("Sam

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

[R] Extract Data form Website Tables

2014-03-01 Thread Doran, Harold
There is a website that populates a table with athlete scores during a competition. I would like to be able to extract those scores from the website and place them into a data frame if this is possible. The website is at the link below: http://games.crossfit.com/leaderboard One complication is

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:

[R] Extract data in word pad

2013-01-12 Thread Roslina Zakaria
Dear r-users,   I have saved data in word pad.  I would like to extract certain part of data only, for example   19710629 08(PARTIAL) 39.3 at interval beginning 19701126 010326 19720629 08(PARTIAL) 33.8 at interval beginning 19720517 144507 19730629 08(PARTIAL) 32.2 a

Re: [R] Extract data

2013-01-11 Thread John Kane
about your installation the faster people may be able to help you. John Kane Kingston ON Canada > -Original Message- > From: shairu...@yahoo.com > Sent: Fri, 11 Jan 2013 01:18:47 -0800 (PST) > To: r-help@r-project.org > Subject: [R] Extract data > > Dear R users,

Re: [R] Extract data

2013-01-11 Thread PIKAL Petr
0:19 AM > To: r-help@r-project.org > Subject: [R] Extract data > > Dear R users, > I just join this forum a few minutes ago. My friend recommend this > forum to me. > > I have data in excel csv. My problem is I would like to extract some > number, for example as highlighte

[R] Extract data

2013-01-11 Thread shairul samat
Dear R users, I just join this forum a few minutes ago. My friend recommend this forum to me.   I have data in excel csv. My problem is I would like to extract some number, for example as highlighted below;   Year Ending   Maximum Value (Rain mm)  Gap from 19710509 09 to 19710607 08000

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

[R] extract data from square cracket

2012-05-16 Thread Min Wang
Dear Sir or Madam, I have a question like this. I want to extract the following data from the square bracket: 1bandband[0.86] 2bandband[0.93] 3noband noband [0.95] 4noband

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

[R] extract data

2012-04-04 Thread Roslina Zakaria
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) data_2: 3.1, 2.5, 2.1,1.4   ( two nonzero data between zero

[R] extract data

2012-04-04 Thread Roslina Zakaria
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) data_2: 3.1, 2.5, 2.1,1.4   ( two nonzero data between zeros data)

[R] Extract data point coordinates from kernel home range estimation

2012-02-27 Thread despina_tg
Hello, I'm very new in working on R and maybe that's a simple thing I'm trying to do, but I am really stuck. I have a data point set of animal tracking coordinates and I have implemented a kernel utilization distribution analysis in order to find the home range for 95% of the relocation data. I

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

[R] Extract Data from Yahoo Finance

2011-11-03 Thread Deb Midya
Hi R –users,   I am using R-2.14.0 on Windows XP.   May I request you to assist me for the following please.   I like to extract all the fields (example: a : Ask, b : Bid, ……, w : 52-week Range, x: Stock Exchange)  for certain period of time, say, 1 October 2011 to 31 October 2011.   Is there any

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

[R] extract data for specific levels factor

2011-10-25 Thread Andrés Aragón
Dear all, I'm trying to analyze data with the following structure: ind cattx age 40.2 por fol peq vh35 41.9 por fol med vh35 68.9 por fol preov vh 35 71.5 por fol peq ser 37 67.5 por fol medser 37 76.9 por fol preov

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

[R] extract data from a column

2011-06-19 Thread Nanami 13
Hi all, I have a column that has the following format: chr1:564588..564589,+ and I want to extract only the coordinates; I have tried writing a regular expression but I couldn't figure out how I should write it. Does anyone know? Thank you, Best, Nanami [[alternative HTML version deleted

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 <-

[R] extract data features from subsets

2011-06-06 Thread Williams Scott
I have a large dataset similar to this: ID timeresult A 1 5 A 2 2 A 3 1 A 4 1 A 5 1 A 6 2 A 7 3 A 8 4 B 1 3 B 2 2 B 3 4 B 4 6 B 5 8

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

[R] extract data from a data frame field

2011-06-06 Thread ads pit
Hi all, I am given the a data frame in which one of the columns has more information together- see column 4, peak_loc: 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,+

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

[R] Extract data

2011-01-06 Thread Chris Mcowen
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 u c r y u etc..

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

[R] Extract data from tseries stl function

2009-10-14 Thread nmo
I have generated a table using the stl function from tseries. How can I extract (other than manual copy) data from a column (eg trend) any help very much appreciated -- View this message in context: http://www.nabble.com/Extract-data-from-tseries-stl-function-tp25898987p25898987.html Sent from

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

[R] extract data from shapefiles

2009-08-14 Thread Kate Zinszer
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" from the class "polygons" within this file and despite my b

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

[R] Extract Data from a Webpage

2008-12-16 Thread Chuck Cleland
Hi All: I would like to extract the provider name, address, and phone number from multiple webpages like this: http://oasasapps.oasas.state.ny.us/portal/pls/portal/oasasrep.providersearch.take_to_rpt?P1=3489&P2=11490 Based on searching R-help archives, it seems like the XML package might have