Re: [R] How to do it in R

2016-06-24 Thread jim holtman
pretty simple: > t_m <- 28e3 > t_b <- 710e3 > ratio <- t_m / (t_m + t_b) * 100 > ratio [1] 3.794038 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Jun 24, 2016 at 12:05 PM, An

Re: [R] Merging Issue

2016-06-18 Thread jim holtman
> dat<-merge(df, df2, by="deps") > > dat deps Subject dates loc grp 1 A 2 2011-01-01 CA DE 2 A 2 2011-01-01 yy xx 3 A 3 2011-01-06 CA DE 4 A 3 2011-01-06 yy xx 5 A 5 2011-01-11 CA DE 6 A 5 2011-01-11

Re: [R] better loop for simulation

2016-06-18 Thread jim holtman
0000 9 | 10 | 0 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sat, Jun 18, 2016 at 6:12 PM, Naresh Gurbuxani < naresh_gurbux...@hotmail.com> wrote: &

Re: [R] String match

2016-06-04 Thread jim holtman
uot;volume", "close") > > # create pattern match > pat <- paste(WhatToLook, collapse = "|") > grep(pat, WhereToLook) [1] 4 5 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On

Re: [R] merging dataframes in a list

2016-06-04 Thread jim holtman
l data frame [2 x 3] name green red (chr) (dbl) (dbl) 1 sample11520 2 sample23010 > Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Jun 3, 2016 at 4:02 PM, Ed Siefker <

Re: [R] read multiple sheets of excel data into R

2016-05-28 Thread jim holtman
Try the 'openxlsx' package. I gave up using XLConnect because of the Java requirement, and speed on larger tables. "openxlsx" has the access routines written in C so you don't need any other outside dependencies. Jim Holtman Data Munger Guru What is the problem that you are tryin

Re: [R] if else condition - help

2016-05-22 Thread jim holtman
] "A" "B" "C" "D" ..$ : chr [1:4] "C1" "C2" "C3" "C4" > x C1 C2 C3 C4 A 0 0 0 0 B 1 0 0 0 C 0 -1 0 0 D -1 1 -1 -1 > Jim Holtman Data Munger Guru What is the problem that you are trying to solv

Re: [R] Merging 2 files with different timestamp

2016-05-22 Thread jim holtman
s.POSIXct('2012-12-27 2330', format = "%Y-%m-%d %H%M") > > # now convert to a common character format for merging > date1_new <- format(date1, "%Y%m%d%H%M%S") > date2_new <- format(date2, "%Y%m%d%H%M%S") > date1_new [1] "20121227233000"

Re: [R] Same sum, different sets of integers

2016-04-27 Thread jim holtman
> cat(strings, sep = '\n') 1, 7 2, 6 3, 5 4, 4 1, 1, 6 1, 2, 5 1, 3, 4 2, 2, 4 2, 3, 3 1, 1, 1, 5 1, 1, 2, 4 1, 1, 3, 3 1, 2, 2, 3 2, 2, 2, 2 1, 1, 1, 1, 4 1, 1, 1, 2, 3 1, 1, 2, 2, 2 1, 1, 1, 1, 1, 3 1, 1, 1, 1, 2, 2 1, 1, 1, 1, 1, 1, 2 1, 1, 1, 1, 1, 1, 1, 1 Jim Holtman Data Munger Gur

Re: [R] From NUM to INT

2016-04-26 Thread jim holtman
Can you explain why you need them as 'integer', A floating point representation can hold a value upto ~4.5e15 as an "integer" keeping the precision that you might need. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not ho

Re: [R] assign color to subsets

2016-04-24 Thread jim holtman
Check the size of df_both. It would be that there are no Command fields that contain both a 't1' and 't2'. You can so do: sum(grepl("t1", df$Command) & grepl("t2", df$Command)) to see how many Command fields contain both. Jim Holtman Data Munger Guru What is the pro

Re: [R] assign color to subsets

2016-04-24 Thread jim holtman
1", Command) & grepl("t2", Command)) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sun, Apr 24, 2016 at 2:36 PM, <chalabi.el...@yahoo.de> wrote: > Thanks Jim, > > my pr

Re: [R] Dividing rows in groups

2016-04-24 Thread jim holtman
ata frame [10 x 3] Groups: ID [5] ID A B (int) (dbl) (dbl) 1 1 1.000 0.4 2 1 0.000 0.6 3 2 0.833NA 4 2 0.167 1.0 5 3 1.000 1.0 6 4NANA 7 4 0.000 1.0 8 4 1.000 0.0 9 5 0.222 1.0 1

Re: [R] assign color to subsets

2016-04-24 Thread jim holtman
RUE)) %>% filter(!(Command %in% c('t1', 't2'))) This will give you a subset with just t1/t2 and you can use 'key' as the colour option for ggplot. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.

Re: [R] Dividing rows in groups

2016-04-24 Thread jim holtman
1.0 6 4NANANANA 7 4 0 1 0.000 1.0 8 4 3 0 1.000 0.0 9 5 2 5 0.222 1.0 10 5 7NA 0.778NA Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to d

Re: [R] Java memory error when reading a small xlsx file

2016-04-24 Thread jim holtman
Try using the openxlsx package; it does not require Java. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sat, Apr 23, 2016 at 3:43 PM, jpm miao <miao...@gmail.com> wrote: > Hi, > >

Re: [R] lists and rownames

2016-04-18 Thread jim holtman
actor w/ 5 levels "1","bottom","con1",..: 3 1 5 2 4 $ con1.1.masked.bottom.red.tsv : Factor w/ 5 levels "1","bottom","con1",..: 3 1 4 2 5 $ con1.1.masked.top.green.tsv : Factor w/ 5 levels "1","con1","green.

Re: [R] Memory problem

2016-04-06 Thread jim holtman
file, what are you doing with the results at the end, etc. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Apr 6, 2016 at 8:44 AM, Amelia Marsh <amelia_mars...@yahoo.com> wrote: > D

Re: [R] Memory problem

2016-04-06 Thread jim holtman
amount of CPU and memory used so far. I use this all the time to keep track of resource consumption in long running scripts. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Apr 6, 2016 at 7:39 AM,

Re: [R] How to convert XML file to R Data Frame?

2016-04-02 Thread jim holtman
from moderate files (~16,000 lines in length). Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Apr 1, 2016 at 12:08 PM, Muhammad Bilal < muhammad2.bi...@live.uwe.ac.uk> wrote: > Hi All, >

Re: [R] receiving Error: unexpected '='

2016-02-29 Thread jim holtman
week(df, 'wk5', 'wk4') Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sun, Feb 28, 2016 at 6:08 PM, KMNanus <kmna...@gmail.com> wrote: > I’m a newbie and trying to execute this simple funct

Re: [R] platform dependent regex

2016-02-09 Thread jim holtman
why 3 parameters on the 'grepl'? Did you mean to say: ​grepl("\\W", "س") # FALSE Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Feb 9, 2016 at 11:55 AM, Ista Zahn <istaz...

Re: [R] Shift all values above certain value by 1

2016-01-23 Thread jim holtman
return value + }) > x a b c other 1 1 2 3 -0.56047565 2 2 3 4 -0.23017749 3 3 4 5 1.55870831 4 4 5 6 0.07050839 5 5 6 4 0.12928774 6 6 4 7 1.71506499 7 4 7 8 0.46091621 8 7 8 9 -1.26506123 9 8 9 10 -0.68685285 10 9 10 11 -0.44566197 ​ Jim Holtman Data Munge

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread jim holtman
Take a look at the data coming in since you may have something that looks like characters (maybe 'blanks'). What you think is numeric in EXCEL might not be.​ Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread Jim Holtman
Write it out as a csv from excel and see what the data looks like.  That may help  in seeing what the problem is. Sent from my Verizon Wireless 4G LTE Smartphone Original message From: Mohsen Jafarikia <jafari...@gmail.com> Date:01/14/2016 11:36 (GMT-05:00) To: jim h

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread jim holtman
.​ Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jan 14, 2016 at 2:30 PM, Mohsen Jafarikia <jafari...@gmail.com> wrote: > Hi Jim, > > I found where the problem is. I had some charac

Re: [R] Trying to avoid the loop while merging two data frames

2015-12-22 Thread jim holtman
oes have 'myid' on it. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Dec 22, 2015 at 12:27 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello! > I have a solut

Re: [R] Filtering Cases with != NA

2015-12-17 Thread jim holtman
use the 'is.na' function: new_dataset <- subset(dataset, subset = !is.na(Turnover)) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Dec 17, 2015 at 7:50 AM, <g.maub...@weinwolf.de> wrote

Re: [R] not allocate of vactor size

2015-11-23 Thread jim holtman
access to a server with 32-64-128GB to see if you can process the data the way you want if you had a larger system. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Nov 23, 2015 at 2:26 PM, Tamsila Parveen

Re: [R] unique identifier for number sequence

2015-11-23 Thread jim holtman
' > x.i <- ifelse(x == 1, indx, 0) > x.i [1] 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 > Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Nov 23, 2015 at 9:59 AM, PIKAL Petr &

Re: [R] unique identifier for number sequence

2015-11-23 Thread jim holtman
> indx <- cumsum(c(x[1L] == 1, diff(x) == 1)) > > # keep just matches with '1' > x.i <- ifelse(x == 1, indx, 0) > x.i [1] 1 1 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 > ​ Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell m

Re: [R] not allocate of vactor size

2015-11-22 Thread jim holtman
on your system to see what is happening.​ Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sun, Nov 22, 2015 at 10:08 AM, Tamsila Parveen via R-help < r-help@r-project.org> wrote: &

Re: [R] get maximum 3 rows by column elements in data frame

2015-11-09 Thread jim holtman
5 1 1 0.5 30 5 5 2 2 1.0 35 5 7 3 1 1.0 40 5 7 5 1 1.0 > Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Nov 9, 2015 at 5:55 AM, Ragia Ibrahim

Re: [R] Subsetting dataframe by the nearest values of a vector elements

2015-11-09 Thread jim holtman
x [1,] "144" "(100,150]" [2,] "179" "(150,200]" [3,] "214" "(200,250]" [4,] "39" "(0,50]" [5,] "284" "(250,300]" [6,] "109" "(100,150]" [7,] "74" "(50,100]

Re: [R] Alternatives for explicit for() loops

2015-11-08 Thread jim holtman
other ways. I don't have time to dig into the code, since there is a lack of comments, to understand why you are using, e.g., 'choose', 'prod', etc.). There are probably a lot of ways of speeding up the code, if could tell us what you want to accomplish. Jim Holtman Data Munger Guru What is

Re: [R] Read a file on every 0.5 (or less) second intervall

2015-11-07 Thread jim holtman
?Sys.sleep Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Nov 6, 2015 at 10:56 PM, Mohammad Tanvir Ahamed via R-help < r-help@r-project.org> wrote: > Hi, > i want to read a file

Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread jim holtman
(indx, function(a){ + row_sum <- rowSums(x[, a]) + x[row_sum < 100, a] <- 0 + x[, a] + }) > # combine back together > do.call(cbind, result) X1 X2 X3 Y1 Y2 Y3 1 1232 357 23 0 9871 72 2 0 00 811 795 743 3 43 919 00 0 Jim Holtman Data Munger

Re: [R] Alternatives for explicit for() loops

2015-11-06 Thread jim holtman
you are doing within the loop that is consuming the time, and until you determine what section of code that is, is it hard to tell exactly what the problem is, much less the solution. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how

Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread jim holtman
an provide a list of the first part of the names to match on to form the groups. You need to provide a reasonable subset of the data so that we can exactly understand what the data is and how it should be grouped. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell m

Re: [R] Alternatives for explicit for() loops

2015-11-01 Thread jim holtman
Why are you recreating the incomb function within the loop instead of defining it outside the loop? Also you are referencing several variables that are global (e.g., m & j); you should be passing these in as parameters to the function. Jim Holtman Data Munger Guru What is the problem that

Re: [R] how to work with time of day (independent of date)

2015-10-30 Thread jim holtman
015-10-31 00:50:00", + "2015-10-31 10:30:00"), class = "factor"), value = c(88L, 17L, + 80L, 28L, 23L, 39L, 82L, 79L)), .Names = c("date", "value"), row.names = c(NA, + -8L), class = "data.frame") > > # extract just the time and summarize b

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread jim holtman
++, tinn-r) support highlighting code and then automatically creating a temporary file that is 'sourced' in. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Oct 29, 2015 at 2:13 PM, Victor Tian <tianx

Re: [R] Extract entries from matrix

2015-10-27 Thread jim holtman
2345 [20,]12345 [21,]12345 [22,]12345 > indx [,1] [,2] [1,]41 [2,]52 [3,]63 [4,]71 [5,]82 [6,]93 [7,] 101 [8,] 112 [9,] 123 > m[indx] [1] 1

Re: [R] condition in triple summation

2015-10-19 Thread jim holtman
Not sure I understand what your condition 'i > j > k' means in the context of where each of the values is 1:3. The only value that meets that condition is i =3, j=2 & k=1, but you said exclude any cases where the values were equal to 1. Can you clarify with an example what you m

Re: [R] sub-sample my data in R from two different tables

2015-10-19 Thread jim holtman
I all you are doing is matching a single column and then extracting rows that match, then the '%in%' operator should work: indx <- reg6idGlobal$alloc_key %in% req6id_subsample_key$alloc_key my_subset <- reg6idGlobal[indx, ] Jim Holtman Data Munger Guru What is the problem that you are

Re: [R] value of variable in ls()

2015-10-18 Thread jim holtman
Is this what you want:: > a <- 1 > b <- 2 > # get current objects > x <- ls() > # create list of values > my_list <- lapply(x, get) > # now add the names > names(my_list) <- x > my_list # print values $a [1] 1 $b [1] 2 Jim Holtman Data Munger Gur

Re: [R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-15 Thread jim holtman
the JDBC driver for SQL Server from Microsoft and install that - is that correct? I hate to start mixing approaches since we have a large number of scripts that currently use the RODBC package, but I will try to see if the approach you proposed do help overcome this problem. Jim Holtman Data Munger

[R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-14 Thread jim holtman
million rows and multiple columns of numerics is that the conversion to/from characters is adding time to the processing. So I was wondering is there a workaround to this problem? Is it possible to add the capability to RODBC when processing SQL Server to avoid this conversion? Or is there some other

Re: [R] Parsing XML File

2015-10-11 Thread jim holtman
3" ... > head(accts_df) key val currency accountName 1 AccountCodeDU108063 DU108063 2 AccountReadytrue DU108063 3 AccountType CORPORATION DU108063 4 AccruedCash 0 AUDDU108063 5 AccruedCash

Re: [R] (no subject)

2015-10-04 Thread jim holtman
> Empl[c(2,4)]$family #>> notice only picks the first object $spouse [1] "Fred" $children [1] 3 $child.ages [1] 4 7 9 To get multiple objects, then you need to use some of the 'apply' functions; in this case 'sapply': > sapply(Empl[c(2,4)], '[[', 'spouse') family family

Re: [R] unixtime conversion

2015-09-22 Thread jim holtman
you can also do: > structure(1183377301, class = c("POSIXct", "POSIXt")) [1] "2007-07-02 07:55:01 EDT" > Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Sep 22

Re: [R] how to split row elements [1] and [2] of a string variable A via srtsplit and sapply

2015-09-10 Thread jim holtman
4283 5 3:62707519 0.42657952 3 62707519 6 2:80464120 0.89125094 2 80464120 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Sep 10, 2015 at 1:46 PM, aldi <a...@wustl.edu> wrote:

Re: [R] Non zero padding dates

2015-08-31 Thread jim holtman
you will probably have to take a guess since your example is also 2015-11-09 06:00; so how do you determine which one. come up with an algorithm and the solution is easy. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you

Re: [R] Convert character Variables to numeric

2015-08-26 Thread jim holtman
Please provide a sample of the data that you are trying to convert. BTW does it have commas in numeric values, or what else is strange about the data. The error message is very clear in the column of data that you are trying to convert is not numeric. Jim Holtman Data Munger Guru What

Re: [R] accessing CRAN through a proxy on 3.2.2

2015-08-21 Thread jim holtman
Thanks. I did find out that for my work environment if I use setInternet(FALSE) then everything seems to work again. They changed the default to TRUE in 3.2.2 and that must have been causing the problem. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me

[R] accessing CRAN through a proxy on 3.2.2

2015-08-21 Thread jim holtman
(and not attached): [1] tools_3.2.2 I was running with --vanilla on the RGUI. I have seen that there were some other people having issues with 3.2.2 and proxies. Is there a fix out there, or are there some other options I need to setup for 3.2.2 to access through a proxy? Jim Holtman Data Munger Guru What

Re: [R] Output In R

2015-08-19 Thread jim holtman
the data. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Aug 19, 2015 at 1:20 AM, Shivi82 shivibha...@ymail.com wrote: Hi Loris, I have already tried options(max.print=99) but does not show

Re: [R] R parallel / foreach - aggregation of results

2015-08-01 Thread jim holtman
you want to process. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sat, Aug 1, 2015 at 3:19 PM, Martin Spindler martin.spind...@gmx.de wrote: Dear Jim, Thank you very much for your response. It seems

Re: [R] R parallel / foreach - aggregation of results

2015-07-31 Thread jim holtman
] for(k in j:n1) { L2distance[j,k] - k*datj } L2distance # return the value } stopCluster(cl) return(x) } Res - Simpar3(100) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do

Re: [R] R parallel - slow speed

2015-07-30 Thread jim holtman
spent. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jul 30, 2015 at 8:56 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Parallelizing comes at a price... and there is no guarantee that you

Re: [R] setwd() command on windows vs. linux/unix

2015-07-27 Thread jim holtman
Try 'choose.dir()' to see if you can navigate to the given directory, or take baby steps by doing one directory at a time. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Jul 27, 2015 at 3:38 PM

Re: [R] Read .xlsx and convert date-column value into Dataframe

2015-07-22 Thread jim holtman
forgot the reply to all: These are serial dates within EXCEL. Here is a way of converting them: as.Date(c(42460, 42426), origin = '1899-12-30') [1] 2016-03-31 2016-02-26 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you

Re: [R] Speeding up code?

2015-07-16 Thread jim holtman
() + + ) user system elapsed 20.905.36 596.57 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jul 16, 2015 at 7:56 AM, Ignacio Martinez ignaci...@gmail.com wrote: Hi Collin, The objective

Re: [R] Speeding up code?

2015-07-16 Thread jim holtman
), stringsAsFactors = FALSE) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jul 16, 2015 at 1:37 PM, jim holtman jholt...@gmail.com wrote: Here is one improvement. Avoid dataframes in some of these cases

Re: [R] convert character vector to decimal for numeric testing

2015-07-15 Thread jim holtman
vector back to character with statements like: if(vec.num[i] 0) { vec.num[i] - LO What is the problem you are trying to solve? Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jul 15, 2015 at 6

Re: [R] Parsing large amounts of csv data with limited RAM

2015-07-14 Thread jim holtman
take a look at the sqldf package because it has the ability to load a csv file to a database from which you can then process the data in pieces Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Jul 14

Re: [R] igraph plot slowness

2015-07-03 Thread jim holtman
node009 ,head=FALSE) system.time({ + network_data -graph.data.frame(topo_data, directed=F) + pdf('test.pdf') + plot(network_data) + dev.off() + }) user system elapsed 0.090.000.16 The PDF file is attached. So maybe it is something with your remote connection. Jim

Re: [R] : Ramanujan and the accuracy of floating point computations - using Rmpfr in R

2015-07-02 Thread jim holtman
This is the standard FAQ 7.31 and then read in detail the referenced paper. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jul 2, 2015 at 2:02 PM, Aditya Singh via R-help r-help@r-project.org wrote

Re: [R] Extracting data from a file containing data

2015-07-01 Thread jim holtman
ML Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Jun 26, 2015 at 5:27 AM, Peter Tuju petere...@ymail.com wrote: Dear Jim Holtman, Thank you very much for your help. The problem

Re: [R] question

2015-07-01 Thread jim holtman
You never said how you wanted to save the data, so I will choose to use 'saveRDS' which should handle most anything. for (i in name_file$names){ saveRDS(prep(z, i), file = paste0(i, '.RDS')) } Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you

Re: [R] question

2015-07-01 Thread jim holtman
')) result # return value that goes in the list }) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jul 1, 2015 at 9:00 PM, jim holtman jholt...@gmail.com wrote: You never said how you wanted

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
27.21333 -0.403 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jun 25, 2015 at 11:40 AM, Peter Tuju petere...@ymail.com wrote: I have the data as attached. For each nino region, I want to get

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
What happened to September? Just disregard? Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jun 25, 2015 at 11:40 AM, Peter Tuju petere...@ymail.com wrote: I have the data as attached. For each

Re: [R] reading daily snow depth data

2015-06-16 Thread jim holtman
1 30 33 6 112 57 103 85 90 49 29 35 14 40 86 90 124 27 113 NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY 45 19 136 22 13 53 65 76 31 106 51 84 2 30 79 64 185 68 70 18 56 103 36 84 Jim Holtman Data Munger Guru What

Re: [R] Scatterplot : smoothing colors according to density of points

2015-06-14 Thread jim holtman
check out the 'hexbin' package for making scatter plots that have a lot of points overlapping in a small area. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Jun 2, 2015 at 9:51 AM, Adams, Jean jvad

Re: [R] matrix/df help populate NA

2015-06-14 Thread jim holtman
Subject AD FH B C 1 x1 4.3 -2.4 1.3 -2.3 NA NA 2 x2 2.4 0.1 0.5 -1.4 NA NA Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sat, Jun 13, 2015 at 11:17 PM, Adrian Johnson

Re: [R] Symbols to data set

2015-06-10 Thread jim holtman
78,00056% $40 3UK 60,00050% $56 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jun 10, 2015 at 8:15 AM, venkadesan venky venkyno...@gmail.com wrote: Hello Friends, I

Re: [R] more complex by with data.table???

2015-06-09 Thread jim holtman
try this: dt[ + , { + result - list() + for (i in names(.SD)){ + result[[i]] - myFunction(unlist(.SD[, i, with = FALSE])) + } + result + } + , by = name + ] name var1 var2 var3 1:a 2.0 22 42 2:b 7.5 28 48 Jim

Re: [R] select portion of text file using R

2015-04-27 Thread jim holtman
NA 1 2 Adeno 1 0.93 3 NA 2 1 Adeno 2 0.78 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Apr 27, 2015 at 5:20 PM, Luigi Marongiu marongiu.lu...@gmail.com wrote: Dear Duncan

Re: [R] Having trouble with gdata read in

2015-03-27 Thread jim holtman
pardon me it was my function which is just a call to readWorksheetFromFile Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Mar 27, 2015 at 3:52 PM, Benjamin Baker bba...@reed.edu wrote: Jim, I’m

Re: [R] Having trouble with gdata read in

2015-03-26 Thread jim holtman
: num 0 NA NA NA 16100 NA NA NA NA NA ... $ Q8.Hourly.ComAMI : num 0 NA NA NA 1600 NA NA NA NA NA ... Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 25, 2015

Re: [R] Timestamp of exported files not updated when the file name is overwritten (ggsave)

2015-03-19 Thread jim holtman
are. Are you looking at the time 'modified' or 'created'; this will make a difference. So a few more particulars about your problem would be helpful. Try running the example for ggsave as I did and see if the times change. Jim Holtman Data Munger Guru What is the problem that you are trying to solve

Re: [R] r help

2015-03-18 Thread jim holtman
Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 18, 2015 at 1:12 PM, thanoon younis thanoon.youni...@gmail.com wrote: Dear all members I have error with the following code #Input data set

Re: [R] [datatable-help] R beginner

2015-03-15 Thread jim holtman
11895251 6 mir145 5890AB 1 4256 8922 7 mir785 12247847AI 12 12047896 12365478 8 mir895 246789AC 2245226 247899 Jim Holtman Data Munger Guru What is the problem that you

Re: [R] Annoyance with %/%

2015-03-11 Thread jim holtman
shouldn't your last expression be: if (any(tst)) big.vector.1[tst] - big.vector.2[tst] Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 11, 2015 at 11:14 AM, William Dunlap wdun...@tibco.com

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-03 Thread Jim Holtman
Send me a copy of your file so I can see what it looks like and what the output should be. Sent from my Verizon Wireless 4G LTE Smartphone div Original message /divdivFrom: Sun Shine phaedr...@gmail.com /divdivDate:03/03/2015 09:43 (GMT-05:00) /divdivTo: jim holtman jholt

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-01 Thread jim holtman
, what = '', sep = ',') Read 9 items scan_words [1] Although this queryapplies specifically to [7] the tm package Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sat

Re: [R] Save a list of list and search for values

2015-02-26 Thread jim holtman
You store it as a list of lists and can then use the lapply function to navigate for values. result - lapply(1:1, function(x){ mix(param[x]) # whatever your call to 'mix' is with some data }) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me

Re: [R] covert entire dataset to numeric while persuing percentage values

2015-02-26 Thread jim holtman
%') # convert to a number as.numeric(gsub(%, , x)) / 100 [1] 0.1200 0.0600 0.0375 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Feb 26, 2015 at 4:06 AM, Methekar, Pushpa (GE Transportation, Non-GE

Re: [R] Processing key_column, begin_date, end_date in R

2015-02-26 Thread jim holtman
3 789102 2015-02-01 2016-02-06 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Feb 25, 2015 at 4:18 PM, Matt Gross gro...@gmail.com wrote: Hi, I am trying to process a large dataset in R

Re: [R] help

2015-02-24 Thread jim holtman
the loop for the plots for (col in seq(ncol(pairs))){ dotPlot(Seq1[[pairs[1, col]]], Seq1[[pairs[2, col]]]) } Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Feb 24, 2015 at 10:32 AM, Ron Flatau

Re: [R] irregular sequence of events

2015-02-20 Thread jim holtman
28 28 NA 29 29 NA 30 30 NA Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Feb 20, 2015 at 9:27 AM, PIKAL Petr petr.pi...@precheza.cz wrote: Dear all I know I am missing something obvious

Re: [R] irregular sequence of events

2015-02-20 Thread jim holtman
22 22 A3 23 23 A3 24 24 A3 25 25 A3 26 26 A3 27 27 A3 28 28 NA 29 29 NA 30 30 NA Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Fri, Feb 20, 2015 at 9:27 AM, PIKAL Petr

Re: [R] How do I access a specific element of a multi-dimensional list

2015-02-20 Thread jim holtman
try this: a = c(2, 3, 5) b = c(aa, bb, cc) c = c(TRUE, FALSE, TRUE) x = list(a, b, c) x [[1]] [1] 2 3 5 [[2]] [1] aa bb cc [[3]] [1] TRUE FALSE TRUE sapply(x, '[[', 1) [1] 2aa TRUE Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you

Re: [R] view large tables

2015-02-17 Thread jim holtman
What is 'large'? have you tried 'View'? Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Feb 17, 2015 at 4:52 AM, carol white via R-help r-help@r-project.org wrote: what is the best function

Re: [R] list of list

2015-02-16 Thread jim holtman
Is this what you mean: ASL - list() for (j in 1:5){ RES - list() for (i in 1:5) RES[[i]] - i ^ j # create list ASL[[j]] - RES # store 'list of list' } Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want

Re: [R] Error: OutOfMemoryError (Java): GC overhead limit exceeded

2015-02-10 Thread jim holtman
Another to try is the 'openxlsx' package if you have '.xlsx' files; it does not read '.xls' files. It seems to be faster than XLConnect and does not require Java; it uses Rcpp to access the APIs. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you

Re: [R] How to download and unzip data in a loop

2015-02-05 Thread jim holtman
try taking the quotes off of 'files' Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Feb 4, 2015 at 5:24 PM, Alexandra Catena amc5...@gmail.com wrote: Hi All, I need to loop through and download

Re: [R] Still trying to avoid loops

2015-02-04 Thread jim holtman
2 6 c 4 3 Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Feb 4, 2015 at 3:08 PM, Tom Wright t...@maladmin.com wrote: No problem with disguise, I'm looking for pretty. On Wed, 2015-02-04

Re: [R] Error: OutOfMemoryError (Java): GC overhead limit exceeded

2015-02-02 Thread jim holtman
resources (CPU and memory) to process. A little more information like what your sessionInfo is would help a lot in responding to your problem. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Feb 2, 2015 at 9

<    1   2   3   4   5   6   7   8   9   10   >