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] add value to Bar chart ggplot2

2016-05-27 Thread Jeff Newmiller
I think you need to read those questions again more carefully... particularly the second one. -- Sent from my phone. Please excuse my brevity. On May 27, 2016 7:41:25 AM PDT, "ch.elahe via R-help" wrote: >Thanks Ulrik, >But in these examples they want to mark the percentage or frequency of >p

Re: [R] couldn't install pcalg package in R 3.1.3

2016-05-27 Thread Jeff Newmiller
If you read the Posting Guide it warns you against posting in HTML (it doesn't say why but basically what you think you sent is not necessarily what we saw). It also mentions that you should update to the latest version of R (yours is not) if you want help (though we might try anyway). It also m

Re: [R] couldn't install pcalg package in R 3.1.3

2016-05-27 Thread Jeff Newmiller
or R version 3.1.3) > > > >On Fri, May 27, 2016 at 1:34 PM, Jeff Newmiller > >wrote: > >> If you read the Posting Guide it warns you against posting in HTML >(it >> doesn't say why but basically what you think you sent is not >necessarily >> what we saw

Re: [R] Dynamically populate a vector by iteratively applying a function to its previous element.

2016-05-27 Thread Jeff Newmiller
You have set yourself an impossible goal. Either you can reformulate your problem as non-iterative and can process your data as arrays, or you have to use some kind of for loop. The lapply and Vectorize functions are popular "pretty" ways to do this, but they amount to hidden for loops. Note t

Re: [R] read.fortran format

2016-05-27 Thread Jeff Newmiller
Your rather sarcastic comment about knowledge given by John's mother seems inappropriate, given that he told you where his information came from and it is the first place you should have looked. The bit about the decimal leading to a shift in the decimal place pointed out by Bill is a bit obsc

Re: [R] Creating R file

2016-05-28 Thread Jeff Newmiller
This sounds like homework, which has been determined to be off-topic on this help list. Please read the Posting Guide before posting. That said, it would appear the OP may need to read about data frames in, say, the Introduction to R... and perhaps about matrices... and using the as.* function

Re: [R] colored table

2016-05-28 Thread Jeff Newmiller
If you don't mix the text and color, heatmaps are pretty standard presentation techniques. -- Sent from my phone. Please excuse my brevity. On May 28, 2016 7:41:53 AM PDT, Bert Gunter wrote: >Hi Naresh: > >I shall be brief, as discussions of what statistical/graphical >techniques >to use are l

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

2016-05-28 Thread Jeff Newmiller
Apparently you need to get your Java runtime setup, or install Perl, depending which of these tools you want to use. Or if your data are laid out simply, you might be able to use the readxl package. -- Sent from my phone. Please excuse my brevity. On May 28, 2016 10:55:50 AM PDT, li li wrot

Re: [R] Trimming time series to only include complete years

2016-05-28 Thread Jeff Newmiller
tat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- Jeff Newmiller

Re: [R] Application of "merge" and "within"

2016-05-28 Thread Jeff Newmiller
Why do you want to do this? -- Sent from my phone. Please excuse my brevity. On May 27, 2016 4:00:14 PM PDT, Santosh wrote: >Dear Rxperts! > >Is there a way to compute relative values.. using within().. function? > >Any assistance/suggestions are highly welcome!! >Thanks again, >Santosh... >

Re: [R] matrix indexing/subset error

2016-05-30 Thread Jeff Newmiller
z %% 2 == 1 has 12 logical values. What do you expect R to do with it worth respect to 4 rows? -- Sent from my phone. Please excuse my brevity. On May 30, 2016 11:38:46 AM PDT, Carl Sutton via R-help wrote: >Hi Guru's >In my quest to understand R I have what I thought was a simple exercise

Re: [R] Trimming time series to only include complete years

2016-05-30 Thread Jeff Newmiller
UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- Jeff Newmi

Re: [R] email threads chronology

2016-05-30 Thread Jeff Newmiller
e https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ------- Jeff Newmiller

Re: [R] Extract from a text file

2016-05-30 Thread Jeff Newmiller
BE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- Jeff NewmillerThe .

Re: [R] Difference subsetting (dataset$variable vs. dataset["variable"]

2016-05-31 Thread Jeff Newmiller
You were clearly mistaken. dataframe$column is almost the same as dataframe[["column"]], except that the $ does partial matching. Both of these "extract" a list element. A data frame is a list where all elements are vectors of the same length. A list is a vector where each element can refer

Re: [R] How to import sensitive data when multiple users collaborate on R-script?

2016-05-31 Thread Jeff Newmiller
Assume everyone will begin their work in a suitable working directory for their computer. Put data in that working directory or some directory "near" it. Then use relative paths to the data instead of absolute paths (don't use paths that start with "/"). I usually start by reading in a "configur

Re: [R] Whether statistical background is must to learn R language

2016-05-31 Thread Jeff Newmiller
In every activity, knowing something about it allows you to avoid repeating the mistakes of the past. There are non-statistical uses of programming languages, so you could use it for domains you are familiar with. Or you could see some intriguing statistical analysis and study in that area to un

Re: [R] Application of "merge" and "within"

2016-05-31 Thread Jeff Newmiller
What is complicated about merge( q, r )? Keep in mind that there is nothing simple about the rules for non-standard evaluation of variables that within() uses, and it only gets more complicated if you try to apply those rules to two data frames at once. While I am not quite sure I understand wh

Re: [R] Application of "merge" and "within"

2016-05-31 Thread Jeff Newmiller
t;within" function, >is >pretty straight forward.. At times there are situations when many, if >not >all, of the operations are needed to be done within the scope the >"within" >environment.. > >Thanks so much.. >Regards, >Santosh > >On Tue, May 31

Re: [R] Extract from a text file

2016-05-31 Thread Jeff Newmiller
gt;v3 <- as.numeric( indta[ firstlines + 1 ] ) ># put it all into a data frame >result <- data.frame( Group = v1, Mean = v2, SE = v3 ) > >result >[1] Group Mean SE ><0 rows> (or 0-length row.names) > >Thank you in advance > > >On Tue, May 31, 2016 at 1:

Re: [R] Training set in Self organizing Map

2016-06-01 Thread Jeff Newmiller
You did not send sample of your data, using dput. Before doing that, I suggest peeling apart your troublesome line of code yourself: str( as.matrix( scale( subdf ) ) ) str( scale( subdf ) ) str( subdf ) And then think about what the scale function does. Does it make sense to ask it to scale c

Re: [R] Making an if condition variable ?

2016-06-01 Thread Jeff Newmiller
Beware of getting too "meta" in your programming... it is rarely worth it. Just write the code and move on with life. That is the beauty of a scripting language. -- Sent from my phone. Please excuse my brevity. On June 1, 2016 7:30:29 PM PDT, ce wrote: > >Dear all, > >I want to make an if con

Re: [R] Convert ncdf data to dataframe

2016-06-02 Thread Jeff Newmiller
The answer to your question is "yes". You probably need to make your example reproducible by including (or referencing by URL) sample data if you want a more complete response. -- Sent from my phone. Please excuse my brevity. On June 2, 2016 1:42:55 AM PDT, Miluji Sb wrote: >Dear all, > >I ha

Re: [R] not common records

2016-06-02 Thread Jeff Newmiller
?merge Pay attention to the all-whatever parameters. -- Sent from my phone. Please excuse my brevity. On June 2, 2016 7:04:47 PM PDT, Ashta wrote: >I have 2 data sets. File1 and File2. Some records are common to both >data sets. For those common records I want get the difference between >d_x1

Re: [R] which function

2016-06-04 Thread Jeff Newmiller
The median is not always a member of the data set. What do you really want? I for one would want people to follow the guidance in the footer on every email on this mailing list. -- Sent from my phone. Please excuse my brevity. On June 4, 2016 9:01:41 AM PDT, Gafar Matanmi Oyeyemi wrote: >De

Re: [R] Faster Multivariate Normal

2016-06-07 Thread Jeff Newmiller
The help file ?dmvnorm is your friend. Read about "x". ghv <- matrix( gh[ as.vector( idx ) ], ncol = dm ) adjFactor2 <- dmvnorm( ghv, mean = mu, sigma = sigma ) -- Sent from my phone. Please excuse my brevity. On June 7, 2016 10:19:53 AM PDT, "Doran, Harold" wrote: >Thanks, Duncan. Not sure I f

Re: [R] Knitr R - how to draw plot exactly at place of plot function call in output document?

2016-06-08 Thread Jeff Newmiller
I would echo the suggestion that the knitr Google group or stackexchange.com would be better than this list for this question. I also suggest that you look at http://yihui.name/knitr/demo/child/ and make a reproducible example if you decide to ask for more help in one of those forums. -- Sent

Re: [R] Reading and converting time data via read.table

2016-06-08 Thread Jeff Newmiller
The canonical way to store times is as difftime vectors. However, there is no simple way to import e.g. HH:MM data directly into such vectors, so you need to embed such times into a longer string that includes a fixed date. After conversion to POSIXct you can subtract the fixed date to get the

Re: [R] R getting "Killed" while running VAR model

2016-06-08 Thread Jeff Newmiller
1. Don't allocate it. 2. If it was, would it make a difference? Seriously, some algorithms need more memory than others, and some packages are more wasteful than others. R is not monolithic... sometimes you just have to roll up your sleeves or buy more memory. -- Sent from my phone. Please

Re: [R] New installation

2016-06-10 Thread Jeff Newmiller
Re this thread: Please stop with the "my favorite Linux" messages. If you have concrete direction as to why R is well supported (preferably links to detailed instructions), that could be construed as "R-help", but "I like it" is unlikely to be useful to an inexperienced user. -- Sent from my ph

Re: [R] summing up a column.

2016-06-10 Thread Jeff Newmiller
Multiple posting happens when you are learning a new system, but reading the posting guide can keep the bleeding down. 1) There is a no-homework policy on this list... different educational organizations have different standards for what is acceptable outside help, so you should be using the s

Re: [R] problem in R2OpenBUGS

2016-06-11 Thread Jeff Newmiller
This is not a reproducible example, and posting in HTML format frequently corrupts R code so don't do it. -- Sent from my phone. Please excuse my brevity. On June 11, 2016 11:15:38 AM PDT, thanoon younis wrote: >Dear R- users > >I have a problem in the R-code, i want to draw some plots in R,h

Re: [R] problem in R2OpenBUGS

2016-06-11 Thread Jeff Newmiller
/ -- Sent from my phone. Please excuse my brevity. On June 11, 2016 11:36:58 AM PDT, thanoon younis wrote: >Thank you very much for your response, how can i solve this problem, i >want >to draw at least BGR plots? > > >Regards > >On 11 June 2016 at 21:33, Jeff Newmiller

Re: [R] summing up a column.

2016-06-13 Thread Jeff Newmiller
e: Ok. Instead of explaining what you have, please send a result of dput(B) and dput(A) And set you mail client to send plain text mail otherwise your code is barely readable. What do you want to do with printed values? What is B? From this it seems that it is data frame but then you try

Re: [R] Binary Value into Text

2016-06-13 Thread Jeff Newmiller
__ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ---

Re: [R] AR1 model using ARIMA

2016-06-14 Thread Jeff Newmiller
Looks like you forgot to read the Posting Guide, too. -- Sent from my phone. Please excuse my brevity. On June 14, 2016 6:30:23 AM PDT, "T.Riedle" wrote: >Sorry, I forgot to attach the file. > > > Dear R users, >I have not received any help regarding my p

Re: [R] Error in twitterR package

2016-06-15 Thread Jeff Newmiller
I have never used that package, but the error message seems clear. You need to use the correct arguments to the setup_twitter_oauth function, and that requires that you interact with twitter parsonally to obtain appropriate credentials. While someone here may be able to give you a pointer as to

Re: [R] Excluding coordinates that fall within a circle

2016-06-17 Thread Jeff Newmiller
This is mostly a domain-specific question about coordinate conversion and algebra, not really about R. However, there are packages that could be useful for this problem that are discussed in the CRAN "Analysis of Spatial Data" Task View [1] and on the R-sig-geo mailing list [2]. Some points to

Re: [R] merging df with world map

2016-06-17 Thread Jeff Newmiller
You should look at your own data before you post. The information in COUNTRY is not the same as the information in region. Also, dput is better than str for posting questions. -- Sent from my phone. Please excuse my brevity. On June 17, 2016 1:06:29 PM PDT, "ch.elahe via R-help" wrote: >Hi a

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-17 Thread Jeff Newmiller
Your code is corrupt because you failed to send your email in plain text format. You also don't appear to have all data needed to reproduce the problem. Use the dput function to generate R code form of a sample of your data. -- Sent from my phone. Please excuse my brevity. On June 17, 2016 1

Re: [R] Problems with Mann-Kendall trend test

2016-06-17 Thread Jeff Newmiller
Not reproducible. Use dput to generate R code form of your data along with the code that gave you the error, and set the email to plain text only when you send it so it doesn't get corrupted when the html is stripped on the mailing list. -- Sent from my phone. Please excuse my brevity. On Jun

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-17 Thread Jeff Newmiller
a.matrix.prod,my.data.var,my.data.var.mat) > > > diff.values <- my.data.matrix.prod-Calc.Qjk.Value#FIND >DIFFERENCE BETWEEN CAL. MATRIX AND ORIGINAL MATRIX > > > Error <- ((colSums ((diff.values^2), na.rm = FALSE, dims = >1))/nrow(my.data.matrix.inj))^0.5#sum of

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-21 Thread Jeff Newmiller
ata.matrix.time, my.data.matrix.inj, my.data.matrix.prod,my.data.var,my.data.var.mat) diff.values <- my.data.matrix.prod-Calc.Qjk.Value#FIND DIFFERENCE BETWEEN CAL. MATRIX AND ORIGINAL MATRIX Error <- ((colSums ((diff.values^2), na.rm = FALSE, dims = 1)

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-21 Thread Jeff Newmiller
d with the method = "L-BFGS-B". Still the error is around >399. >How can we reduce it? > >Priyank > >On 21 June 2016 at 12:18, Jeff Newmiller >wrote: >> The size of this request is a bit big for this list. >> >> I think you need the constrOptim func

Re: [R] filtering data by the time stamp

2016-06-21 Thread Jeff Newmiller
This is normal. R is a (mostly) functional language, which means functions normally don't have side effects like changing input data. Try saving the result of your function calls in a new object. -- Sent from my phone. Please excuse my brevity. On June 21, 2016 3:57:54 PM PDT, Alice Domalik <

Re: [R] Saving .eps files with Times New Roman font

2016-06-23 Thread Jeff Newmiller
Not that I am an expert, but you should probably be using the direct approach rather than pointing and clicking. ?postscript ?cairo_ps -- Sent from my phone. Please excuse my brevity. On June 23, 2016 10:15:15 AM PDT, A A via R-help wrote: >In RGui, I'm running the following bit of code: >win

Re: [R] Fwd: Fwd: RE: Heatmap.2 Breaks argument

2016-06-24 Thread Jeff Newmiller
Did you try the maintainer() function? -- Sent from my phone. Please excuse my brevity. On June 24, 2016 10:45:07 AM PDT, fgoetz wrote: >Dear Mr. or Mrs., > >Please see the previous messages for information. I had a problem with >the heatmap.2 breaks argument and was wondering if someone could

Re: [R] Rattle

2016-06-24 Thread Jeff Newmiller
This is like asking, "My car doesn't work. Can anyone tell me what is wrong?" Please spend some time reading (and paying attention to) the Posting Guide before sending any more emails here. -- Sent from my phone. Please excuse my brevity. On June 24, 2016 11:49:32 AM PDT, deva d wrote: >hi al

Re: [R] How I can calculate the value of response variable

2016-06-26 Thread Jeff Newmiller
Can you provide an example of what you mean? This is not a statistical theory forum, so you should be able to describe the calculation clearly if you want help translating it into R. Also, read the Posting Guide, which among other things warns you that this is a plain text mailing list so your

Re: [R] Fwd: Fwd: RE: Heatmap.2 Breaks argument

2016-06-27 Thread Jeff Newmiller
t work for heatmap.2. > >Best, > >Florian > > >Am 24.06.2016 um 17:08 schrieb Jeff Newmiller: >> Did you try the maintainer() function? __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailm

Re: [R] API key at start-up

2016-06-27 Thread Jeff Newmiller
"Assign ... key to a value" defies my understanding of those terms, and includes no context (API is a very vague term). We are not (necessarily) subject area experts in your preferred domain of jargon. Doing things when you start up your session is typically done as described in ?Startup -- S

Re: [R] performance of do.call("rbind")

2016-06-27 Thread Jeff Newmiller
Your description of the data frames as "approx" puts the solution to considerable difficulty and speed penalty. If you want better performance you need a better handle on the data you are working with. For example, if you knew that every data frame had exactly three columns named identically a

Re: [R] performance of do.call("rbind")

2016-06-27 Thread Jeff Newmiller
) with approx 200k data.frames with dim(data.frame) approx 100x3. a call data <-do.call("rbind", data.list) does not complete - run time is prohibitive (I killed the rsession after 5 minutes). I would think that merging data.frame's is a common operation. Is

Re: [R] (sin asunto)

2016-06-28 Thread Jeff Newmiller
Follow the listinfo link in the footer. You should be in possession of a password with which to make changes to your subscription there. -- Sent from my phone. Please excuse my brevity. On June 28, 2016 2:46:19 AM PDT, "Monse Buenaño" wrote: >Excuse me, I want to change my e-mail adress, where

Re: [R] Not able to install RODBC package

2016-06-28 Thread Jeff Newmiller
Try another mirror? Try the RMySQL package instead? Ask on R-sig-db? -- Sent from my phone. Please excuse my brevity. On June 28, 2016 1:36:47 PM PDT, Vivek Singh wrote: >> install.packages('RODBC') >Installing package into ‘/home/vivek/R/x86_64-pc-linux-gnu-library/3.0’ >(as ‘lib’ is unspecifi

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-02 Thread Jeff Newmiller
I can understand you not wanting to supply your actual data online, but only you know what your data looks like so only you can create a simulated data set that we could show you how to work with. -- Sent from my phone. Please excuse my brevity. On July 2, 2016 2:57:39 AM PDT, Kevin Wamae wro

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-02 Thread Jeff Newmiller
again.. > > >Regards >--- >Kevin Kariuki > > >On 7/2/16, 7:37 PM, "Jeff Newmiller" wrote: > >I can understand you not wanting to supply your actual data online, but >only you know what y

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-03 Thread Jeff Newmiller
## >> >> On 7/3/16, 8:42 AM, "Jeff Newmiller" >wrote: >> >> You are making this hard on yourself by not paying attention the >Po

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-03 Thread Jeff Newmiller
3 1/21/08 20081 5/11/07 >R1/3 1/28/08 20081 5/11/07 >R1/3 2/4/08 Y 20082 > > >Regards >--- >Kevin Wame > >#

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-03 Thread Jeff Newmiller
borative Research Programme >Centre for Geographic Medicine Research >P.O. Box 230-80108, Kilifi, Kenya > > >On 7/3/16, 9:34 PM, "Jeff Newmiller" wrote: > >I still get the impression from your mixing of information types that >you are thinking like this is Exc

Re: [R] R - Populate Another Variable Based on Multiple Conditions | For a Large Dataset

2016-07-03 Thread Jeff Newmiller
> >> ID datedrug_admin yearmonth diff_days >> R1/35/11/2007 Y 20075 0 >> R1/35/16/2007 20075 6 >> R1/35/22/2007 20075 11 >> R1/35/28/2007 20075 1

Re: [R] WG: Fw: Re: dplyr : row total for all groups in dplyr summarise

2016-07-06 Thread Jeff Newmiller
Cut and paste is not to blame... it is the use of word processing software rather than text editors for manipulating code that is the problem. Georg: note that plyr does not mix very well with dplyr... try to pick one and stick with it. -- Sent from my phone. Please excuse my brevity. On Jul

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-06 Thread Jeff Newmiller
My point is that this is highly software-dependent. Certain email programs and editors are worse than others in inclusion of configuration settings that allow you to avoid this problem. In general you need to look for "plain text" options, and some software has "Auto-Correct" options turned on b

Re: [R] Bessel function dll file use in VBA

2016-07-07 Thread Jeff Newmiller
This is not a VBA support forum. You need to be studying VBA linkage requirements and gcc linkage conventions, and neither of these subject areas are on topic in R-help. -- Sent from my phone. Please excuse my brevity. On July 7, 2016 5:27:02 AM PDT, "Mehta, Gaurang" wrote: >Hi Team, >I am tr

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Same as with any floating point numeric computation environment... you don't. There is always uncertainty in any floating point number... it is just larger in this data than you might be used to. Once you get to the stage where you want to output values, read up on ?round ?par (digits) and don

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Correction: ?options (not par) -- Sent from my phone. Please excuse my brevity. On July 7, 2016 3:26:06 PM PDT, Jeff Newmiller wrote: >Same as with any floating point numeric computation environment... you >don't. There is always uncertainty in any floating point number... it >

Re: [R] WRS2 package problems with post hoc test lincon

2016-07-08 Thread Jeff Newmiller
1) HTML formatted email does not come through reliably. Please read the Posting Guide. 2) It is very nearly always necessary to provide a reproducible example when asking for help on this list to avoid complete failure to communicate. 3) Given the above limitations (meaning I may not be under

Re: [R] How to make the "apply" faster

2016-07-09 Thread Jeff Newmiller
function(y) {sum(y>=70)} -- Sent from my phone. Please excuse my brevity. On July 9, 2016 1:19:27 PM PDT, Debasish Pai Mazumder wrote: >I have 4-dimension array x(lat,lon,time,var) > >I am using "apply" to calculate over time > new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))}) > >Th

Re: [R] [FORGED] Regression with factors ?

2016-07-09 Thread Jeff Newmiller
I have seen less sensical questions. It would be nice if the example were a bit more complete (as in it should have excess degrees of freedom and an answer) and less like a homework problem (which are off topic here). It would of course also be helpful if the OP were to conform to the Posting G

Re: [R] Help- Converting the ODE equation to fuzzy logic in R

2016-07-10 Thread Jeff Newmiller
The only reason I can imagine for such a "need" is that you have been assigned homework and there is a no-homework policy on this list. That said, Google came up with at least one hit when I looked. You really ought to read the Posting Guide before posting again. -- Sent from my phone. Please

Re: [R] [FORGED] Regression with factors ?

2016-07-11 Thread Jeff Newmiller
values of the >factor-levels and numerical values for the multiplier (f) and the >offset (o), with p1 and p2 given as names (here: persons) and y given >as some level of achievement they reach by cooperating. > >y = f * ( o - ( p1 - p2 )^2 ) > >Is that what you meant by "answ

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread Jeff Newmiller
s://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- Jeff Newmiller

Re: [R] Forking and adapting an R package

2016-07-14 Thread Jeff Newmiller
1) Although it can be as easy as this, when you are dealing with packages the complications of namespaces may prevent your modified version of the function now in the global namespace from being used by other functions in the package. That is, you may have to redefine all of the interrelated fun

Re: [R] Selecting 1st and last dates from a set of dates

2016-07-14 Thread Jeff Newmiller
I suspect the answer to your question (is there a function...) is almost certainly yes, but your question is too vague to be sure. 1) Data frames and matrices are different in important ways... it is highly unlikely that matrices would be appropriate for date data. 2) Do you mean "select recor

Re: [R] Geom_smooth

2016-07-20 Thread Jeff Newmiller
No, it refers to confidence level. Refer to your training in statistics for that definition. -- Sent from my phone. Please excuse my brevity. On July 20, 2016 10:01:44 AM PDT, Tom Subia wrote: >Default level = 0.95. >Does this mean +/- 0.025 from estimate? > > [[alternative HTML version d

Re: [R] how to expand the dataframe

2016-07-20 Thread Jeff Newmiller
Look at the zoo or data.table packages. -- Sent from my phone. Please excuse my brevity. On July 20, 2016 1:31:26 PM PDT, lily li wrote: >Hi R users, > >I have a dataframe, where there is a column 'time' represents time >series >but is not complete. How to expand the dataframe so this column wi

Re: [R] PDF extraction with tm package

2016-07-22 Thread Jeff Newmiller
This is neither the Xpdf support forum nor the Windows Setup Program Reinvention support group... and you really need to read and follow the Posting Guide for the R mailing lists. FWIW I would guess that you need to learn about environment variables and in particular about the PATH variable. Th

Re: [R] Using C library in R

2016-07-22 Thread Jeff Newmiller
Read the Posting Guide. This will tell you at least two important things: 1) Post using plain text. HTML mangles code. 2) Interfacing R with other languages is off-topic on this list. There are other lists where such issues are on-topic. Your post is a bit like walking into a bowling alley and

Re: [R] Using C library in R

2016-07-22 Thread Jeff Newmiller
You are entitled to your opinion, but apparently you have not read the Posting Guide either. -- Sent from my phone. Please excuse my brevity. On July 22, 2016 6:00:19 PM PDT, Dirk Eddelbuettel wrote: >Jeff Newmiller dcn.davis.ca.us> writes: >> 2) Interfacing R with other lang

Re: [R] Improving performance by rewriting for loops into apply functions

2016-07-22 Thread Jeff Newmiller
If you complain to the doctor that it hurts when you ram your head into the wall, (s)he is going to tell you to not so that. What do you expect us to say? You seem full of misinformation. The apply family functions do not necessarily speed anything up... they are just more compact than for loop

Re: [R] knitr package error.

2016-07-26 Thread Jeff Newmiller
The mailing list allows very few types of attachments through to limit virus problems. You need to learn how to convey your problem as a reproducible sequence of R statements to get clear assistance here. [1] In this case, you may be confused between the interactive working environment (variab

Re: [R] Aggregate matrix in a 2 by 2 manor

2016-07-27 Thread Jeff Newmiller
An alternative (more compact, not necessarily faster, because apply is still a for loop inside): f <- function( m, nx, ny ) { # redefine the dimensions of my a <- array( m , dim = c( ny , nrow( m ) %/% ny , ncol( m ) %/% nx ) )

Re: [R] font size in graphs...can R read Windows settings?

2016-07-27 Thread Jeff Newmiller
What if it is being used on a platform other than Windows? This problem is more challenging than you seem to think it is. I would suggest including a kind of "par" argument to your function that lets the user change your defaults. -- Sent from my phone. Please excuse my brevity. On July 27, 2

Re: [R] Fuzzy variable universe

2016-07-28 Thread Jeff Newmiller
This appears to be a question about a contributed package, though you have not specified which one (so your example code is not reproducible). Be warned that I have never seen discussion of fuzzy logic on this list, so any help you get here is likely to be from someone reading the documentation

Re: [R] problems reading XML type file from ishares website

2016-07-28 Thread Jeff Newmiller
XLS has nothing to do with XML. The shift from XLS to XLSX/XLSM formats was where XML was introduced. You might occasionally find mislabelled files that seem to work anyway, but there is a significant difference inside true XLS files. Use a package designed to handle your data format. There ar

Re: [R] problems reading XML type file from ishares website

2016-07-28 Thread Jeff Newmiller
pies. You must >not, directly or indirectly, use, disclose, distribute, >print or copy any part of this message or any attachments if you are >not >the intended recipient. > > >-Original Message- >From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] >Sent: Thursday,

Re: [R] problems reading XML type file from ishares website

2016-07-28 Thread Jeff Newmiller
Er, I failed to include the step to write the repaired data to a file... fnamenobom <- "nobom.xml" cat( paste( txt, collapse="\n" ), file=fnamenobom ) xmlfile <- xmlTreeParse( fnamenobom ) -- Sent from my phone. Please excuse my brevity. On July 28, 2016 11:20

Re: [R] Subtraction with aggregate

2016-07-28 Thread Jeff Newmiller
What represents the difference when multiple values are present? sd? -- Sent from my phone. Please excuse my brevity. On July 28, 2016 1:40:16 PM PDT, Gang Chen wrote: >With the following data in data.frame: > >subject QMemotion yi > s1 75.1017 neutral -75.928276 > s2 -47.3512

Re: [R] How to pass na.rm=T to a user defined function

2016-07-28 Thread Jeff Newmiller
Why not remove it yourself before passing it to those functions? -- Sent from my phone. Please excuse my brevity. On July 28, 2016 5:51:47 PM PDT, Jun Shen wrote: >Dear list, > >I write a small function to calculate multiple stats on multiple >variables >and export in a format exactly the way I

Re: [R] EM algorithm for maximizing the likelihood of Multivariate Hawkes process

2016-07-28 Thread Jeff Newmiller
How did you try to find the answer before posting? Some possibilities might be go ogling [1] or perusing CRAN to find [2]... Note that HTML tends to mangle code... please follow the Posting Guide and send plain text email to this list. [1] http://bfy.tw/6y3o [2] https://cran.r-project.org/web/v

Re: [R] Reduce woes

2016-07-29 Thread Jeff Newmiller
Having experienced some frustration myself when I first started with R many years ago, I can relate to your apparent frustration. However, if you would like to succeed in using R I strongly recommend learning R and not trying to write Haskell or Erlang or C or Fortran or any other language when

Re: [R] %in% with matrix of lists

2016-07-30 Thread Jeff Newmiller
>> [1] TRUE FALSE TRUE FALSE ## NOT c(T,F,T,F) > >I'm not sure what you mean by NOT here. You get the same answer as I >do, as far as I can see. > # valid R T <- FALSE # invalid R TRUE <- FALSE It is much much safer and clearer to use TRUE/FALSE than T/F. So c( TRUE, FALSE, TRUE, FALSE ) ma

Re: [R] Aggregate matrix in a 2 by 2 manor

2016-07-30 Thread Jeff Newmiller
ncol(data)/nx) >+ } >> aggregate.nx.ny.expand.grid(tst.small) > [,1] [,2] [,3] [,4] >[1,] 3.5 11.5 19.5 27.5 >[2,] 5.5 13.5 21.5 29.5 >> >> aggregate.nx.ny.array.apply = function(data,nx=2,ny=2, FUN=mean,...) >{ >+ a <- array(data, dim = c(ny, nrow( d

Re: [R] Aggregate matrix in a 2 by 2 manor

2016-07-30 Thread Jeff Newmiller
3 3412.639 100 c # 9.191747 21.98528 10.30099 15.9169 158.687 100 a # 733.246331 936.73359 757.58383 844.2016 2824.557 100 b On Sat, 30 Jul 2016, Jeff Newmiller wrote: For the record, the array.apply code can be fixed as below, but then it is slower than the expand.grid version. a

Re: [R] Replace any values in a data frame based on another data frame

2016-07-30 Thread Jeff Newmiller
ve HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, se

Re: [R] Arcsine Tranformation.

2016-07-31 Thread Jeff Newmiller
o.nz/Reproducibility.html ------- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#.

Re: [R] Read output:

2016-08-02 Thread Jeff Newmiller
R could not find the specified file. Either it is not there or file system permissions (off topic here) prevented access to the file. -- Sent from my phone. Please excuse my brevity. On August 1, 2016 11:30:42 PM PDT, roslinazairimah zakaria wrote: >Dear r-usersl, > >I don't understand this c

Re: [R] What is "args" in this function?

2016-08-02 Thread Jeff Newmiller
Unfortunately for you, this email list is about R (not C), and while the Posting Guide indicates that questions discussing how to interface with C belong in R-devel, that is not a forum for learning C. On the plus side, the data types and macros you are asking questions about are highly specif

Re: [R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread Jeff Newmiller
x <- rnorm( 2, 5, 2.5 ) The requirement for "random" is ill-specified because it omits mention of which random distribution you want (I assumed normal distribution above). The requirement for "decimal places" is ill-defined because floating point numbers are internally represented with mant

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