Re: [R] Scale y-labels based on a value with 'lattice'

2016-05-26 Thread Duncan Mackay
Hi If you want to change the cex of the labels see library(lattice) ?yscale.components.default Possibly an easier way is to size the symbols I will use Jims data.frame to plot with lattice dotplot(Group.2 ~ x, data = kedf, scales = list(y = list(labels = kedf[,"Group2"], cex

Re: [R] rollapply and difftime

2016-05-26 Thread Nordlund, Dan (DSHS/RDA)
Another option Daily$tmdiff <- with(Daily, c(NA, diff(Date, units='days'))) Hope this is helpful, Dan Daniel Nordlund, PhD Research and Data Analysis Division Services & Enterprise Support Administration Washington State Department of Social and Health Services > -Original Message- >

Re: [R] rollapply and difftime

2016-05-26 Thread Jeff Newmiller
What about just diff( dts ) or as.numeric( diff( dts ), units="days" ) ? -- Sent from my phone. Please excuse my brevity. On May 26, 2016 5:09:20 PM PDT, "MacQueen, Don" wrote: >You want the number of days between dates? >Does this do the trick? > >dts <- Sys.Date()+ c(1,2,3,5,6,9) >dts[-1]

Re: [R] rollapply and difftime

2016-05-26 Thread MacQueen, Don
You want the number of days between dates? Does this do the trick? dts <- Sys.Date()+ c(1,2,3,5,6,9) dts[-1] - dts[-length(dts)] Time differences in days [1] 1 1 2 1 3 -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 5/26/1

[R] rollapply and difftime

2016-05-26 Thread Morway, Eric
Technically, the code below works and results in a column that I'm interested in working with for further processing. However, it is both inefficient on lengthy (>100 yr) daily time series and is, frankly, not the R way of doing things. Using the 'Daily' data.frame provided below, I'm interested

Re: [R] Match Coordinates to NUTS 2 ID

2016-05-26 Thread MacQueen, Don
Perhaps the over() function in the sp package. (in which case, R-sig-geo might be a better place to ask). -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 5/26/16, 2:30 PM, "R-help on behalf of Miluji Sb" wrote: >Dea

Re: [R] Scale y-labels based on a value with 'lattice'

2016-05-26 Thread Jim Lemon
Hi Kimmo, I was unable to work out how to do this in lattice, but this might help: kedf<-read.table(text="Group.1Group.2 x Freq deutschland achtziger 2.001 deutschlandalt 1.254 deutschland anfang -2.001 deutschlandansehen 1.002 deutschland arbei

Re: [R] subset data right

2016-05-26 Thread William Dunlap via R-help
You did not change df$quant - you made a new object called 'subdf' containing a column called 'quant' that had only one level. Changing subdf has no effect on df. > df <- data.frame(quant=factor(letters)) > str(df) 'data.frame': 26 obs. of 1 variable: $ quant: Factor w/ 26 levels "a","b","c",

[R] Match Coordinates to NUTS 2 ID

2016-05-26 Thread Miluji Sb
Dear all, I have downloaded the NUTS 2 level data from library(“rgdal”) library(“RColorBrewer”) library(“classInt”) #library(“SmarterPoland”) library(fields) # Download Administrative Level data from EuroStat temp <- tempfile(fileext = ".zip") download.file(" http://ec.europa.eu/eurostat/cache/G

Re: [R] subset data right

2016-05-26 Thread ruipbarradas
Hello, Don't use subset, use indexing. subdf <- df[df$quant %in% "VeryFast", ] By the way, instead of %in% you can use ==, since you're interested in just one value of quant. Hope this helps, Rui Barradas Citando ch.elahe via R-help : > Hi all, > I have the following df and I want to know

Re: [R] Fortune candidate, was Re: Shaded areas in R

2016-05-26 Thread Achim Zeileis
On Thu, 26 May 2016, Michael Dewey wrote: In a reply Duncan said Nice, thanks, added to the "fortunes" package on R-Forge now. Best, Z On 26/05/2016 16:12, Duncan Murdoch wrote: On 26/05/2016 11:03 AM, Óscar Jiménez wrote: You should try things; R won't break. Duncan Murdoch __

[R] JM plotting

2016-05-26 Thread Jennifer Sheng
Dear Users, When the joint modeling was run in ER, the run was completed successfully with co-eff output. However, in the terms plotting, somehow the plot (fitjoint.null) does not work, with following error message. Any advice from the group? Thank you very much! Best regards, Jenny Error in

Re: [R] Shaded areas in R

2016-05-26 Thread Óscar Jiménez
Thanks for your answers I'm going to share my script and my database in an excel file, where you can check the kind of graph I would like to make (see attached document, you can find it in Sheet1. Sheet 3 is the one that I used in .csv format to work with in R). Script: # HYDROGRAPH SEPARATION A

[R] Scale y-labels based on a value with 'lattice'

2016-05-26 Thread K. Elo
Dear R-helpers! I have a data frame storing data for word co-occurrences, average distances and co-occurence frequency: Group.1Group.2 x Freq 1 deutschland achtziger 2.001 2 deutschlandalt 1.254 3 deutschland anfang -2.001 4 deutschlandansehen 1.00

[R] Factor Analysis using weights for each variable

2016-05-26 Thread Preetam Pal
Hi R-users, I have 1020 time series ( each of length 10,000), say, X1,X2,..,X1020 and I want to perform Factor Analysis using 50 factors on their correlation matrix. The issue is: for every series, I have a weight, i.e. *the series X_i has a pre-defined weight of w_i* ( i = 1,2,, 1020). I

[R] subset data right

2016-05-26 Thread ch.elahe via R-help
Hi all, I have the following df and I want to know which Protocols are VeryFast, which are FAST, which are SLOW and also which ones are VerySLOW : $ Protocol : Factor w/ 48 levels "DP FS QTSE SAG",..: 5 5 28 5 5 5 7 7 47 5 ... $ quant : Factor w/ 4 levels "FAST","SLOW",.

[R] Proportion of 1's in terminal nodes of CTREE()

2016-05-26 Thread Preetam Pal
Hi R-users, I have created a Conditional Tree using the ctree function ( in package partykit). The data had a factor - the y variable - and a host of categorical x-variables. Now, I want to find the proportion of cases where y = 1 in each of the terminal nodes. Is it possible to do so programmat

[R] Fortune candidate, was Re: Shaded areas in R

2016-05-26 Thread Michael Dewey
In a reply Duncan said On 26/05/2016 16:12, Duncan Murdoch wrote: On 26/05/2016 11:03 AM, Óscar Jiménez wrote: You should try things; R won't break. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://st

Re: [R] Shaded areas in R

2016-05-26 Thread Duncan Murdoch
On 26/05/2016 11:03 AM, Óscar Jiménez wrote: Hi Duncan, Thanks for the quick reply :) Does the function Sys.Date return a time series (created with the function POSIXct), with numerical values? It returns a Date object. The str() function will show you that. But Date, POSIXct, and even POS

Re: [R] Shaded areas in R

2016-05-26 Thread Duncan Murdoch
On 26/05/2016 5:37 AM, Óscar Jiménez wrote: Hello, I'm working with R language, and plotting some parameters over time. I need to draw a shaded area under the curve of eacj parameter. For that, I might use the polygon (x,y) function, assigning coordinates (x,y) to each vertex of my polygon. To

Re: [R] Shaded areas in R

2016-05-26 Thread Tom Wright
Hi Óscar, Not really sure what you mean by the time variable being a "character" vector. Unless you are plotting a barchart or boxplot (or similar), I don't this this makes sense. If you can post a sample of your data, preferably using the dput() command we can probably help more. On Thu, May 26,

[R] Segmentation Fault with large dataframes and packages using rJava

2016-05-26 Thread Sebastian Salentin
Dear all, I have been trying to perform machine learning/feature selection tasks in R using various packages (e.g. mlr and FSelector). However, when giving larger data frames as input for the functions, I get a segmentation fault (memory not mapped). This happened first when using the mlr ben

[R] Shaded areas in R

2016-05-26 Thread Óscar Jiménez
Hello, I'm working with R language, and plotting some parameters over time. I need to draw a shaded area under the curve of eacj parameter. For that, I might use the polygon (x,y) function, assigning coordinates (x,y) to each vertex of my polygon. To do so, "x" and "y" must be vectors with numeri

Re: [R] Computing means of multiple variables based on a condition

2016-05-26 Thread Thierry Onkelinx
Another option would be to convert the data into a long format and add columns for each condition. library(dplyr) library(tidyr) DF %>% gather(key = "key", value = "value", -a, -d) %>% mutate( "d>=2" = ifelse(d >= 2, value, NA), "d>=4" = ifelse(d >= 4, value, NA), "d>=6" = ifelse(d

Re: [R] R help- fit distribution "fitdistr"

2016-05-26 Thread Bert Gunter
Inline. On Thursday, May 26, 2016, Jessica Wang <25695...@qq.com> wrote: > Hello, I just start using R. I want to use “fitdistr” to fit distribution > of the data. Then how can I verify if the data really fit the distribution? > Thanks [data is attached] > > You can't. There are many ways to judg