I'm calling a stored procedure that returns multiple tables and my current
framework uses RODBC and sqlQuery() to communicate between R and the databases
we connect to. A new stored procedure returns multiple tables and I found this
on SO indicating that RODBC "may not" be able to retrieve multi
Now that’s brilliant! And to get a vector of counts I could extend it to
rr <- crossprod(!is.na(tmp))
rr[lower.tri(rr),]
Thanks, Bill!
From: William Dunlap
Sent: Tuesday, January 21, 2020 3:00 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] N Sizes between Pairs of Colu
I'm trying to find an efficient way to find the N size on correlations produced
when using the pairwise option in cor().
Here is a sample to illustrate:
### Create a sample data frame
tmp <- data.frame(v1 = rnorm(10), v2 = rnorm(10), v3 = rnorm(10), v4 =
rnorm(10))
### Create some random miss
John
Indeed, this was the issue. I needed to modify my windows path to include both
Rtools and the version of R I am using.
Thank you.
-Original Message-
From: Fox, John
Sent: Friday, September 6, 2019 9:35 AM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Help
I've done the following steps, but am unable to source in the Cpp files.
Details of my session and sessionInfo are below. Am I missing a package, or a
critical step? I found one answer regarding the 'make" error on stackoverflow
suggesting the problem is resolved by grabbing the more recent vers
Yes, see Shiny by R studio. Here is an example of my site that is built on
Shiny and R. It also combines CSS, SQL, javascript, and some HTML.
https://shiny.airast.org/METRICS/
-Original Message-
From: R-help On Behalf Of Cleber N.Borges
Sent: Monday, August 26, 2019 7:48 PM
To: r-help@r
Here is a toy example of what I want
library(lattice)
result <- data.frame(score = 1:10, theta = seq(from = -5, to = 5, length = 10))
result$theta2 <- result$theta + .3
xyplot(score ~ theta + theta2, result, type = c('g', 'l'))
However, in reality, the number of variables along the x-axis will v
You're asking a question unrelated to R programming and so you won't get a
useful response here. However, your question also suggests a misunderstanding
of IRT. Generating multi-dimensional data involves generating ability estimates
with additional nuisance dimensions and that has no relationshi
The help for cov() clearly notes that pairwise only works with pearson. I'm
curious why as it is surely not computational. Certainly an analyst knows the
nature of the missingness in their data and if it's not MCAR then applying
pairwise to spearman would have the same inferential consequence as
You need to say what function in R is creating this. However, how are you
getting a discrimination parameter for Rasch?
-Original Message-
From: R-help On Behalf Of shreepad khandve
Sent: Wednesday, June 19, 2019 2:49 AM
To: r-help@r-project.org
Subject: [R] Regarding R doubt on rasch mo
David
Most of us use an editor of some kind to write our code. I use Notepad++ but
there are many options. In this way, you simply write your code in a text file
and save it.
Some editors allow for you to execute your code from the script.
-Original Message-
From: R-help On Behalf Of
_1.0.0 crayon_1.3.4
utf8_1.1.4 fansi_0.2.3
[13] rlang_0.3.0.1
-Original Message-
From: Sarah Goslee
Sent: Wednesday, April 24, 2019 11:12 AM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Read_fwf in package readr, double vs. numeric
Hi,
I can'
Suppose I have the following data sitting in a fwf file 'foo.txt'. The point of
this email is to ask the group how to properly read in the value in this
pseudo-data "1e-20" using the read_fwf function in the package readr.
11e-201043
1712201043
1912201055
First, suppose I do it this way, where
Do you mean like this?
tmp <- data.frame(v1 = c(1,2,1,4,2), v2 = c(10, 11, 10, 14, 11))
vals <- paste(tmp$v1, tmp$v2, sep ='')
tmp[which(vals %in% vals[duplicated(vals)]),]
On 3/8/19, 12:51 PM, "Silvano Cesar da Costa" wrote:
>Hi,
>
>I have a dataset with ten columns, but I need extract only
Lars
Typically answers regarding shiny are not answered here (I do wish there was a
SIG, however). With that said, are you saying that the object size is
increasing for objects that previously were much smaller? Or, are other things
now being saved into the workspace that were not there previou
More of a general query, but looking to see if others have successfully used
something like the foreach package (or other parallel style functions) with
certain functions that minimize likelihood or objective functions (e.g.,
optim/nlminb).
I have had great success with embarrassingly parallel
Yeah, you might not be able to go much faster here unless A has some
specialized structure that you can take advantage of (e.g., sparsity)?
On 8/10/18, 11:22 AM, "Ravi Varadhan" wrote:
>Hi,
>
>I would like to compute: A %*% B %*% t(A)
>
>
>
>A is a mxn matrix and B is an nxn symmetric, positive
anyone happens to know, hints are appreciated
Harold
-Original Message-
From: MacQueen, Don [mailto:macque...@llnl.gov]
Sent: Thursday, July 26, 2018 11:26 AM
To: Doran, Harold ; 'r-help@r-project.org'
Subject: Re: [R] SQL Database
From my point of view, the logic is thi
I'm doing some work now to learn which SQL database package is the most optimal
for the task I am working on. There are many packages, and I'm reviewing the
documentation on some of them now. I am seeking advice from those of you who
might suggest a package to use for the task I am currently wor
ot;identical[(][^,]+,[ ]*TRUE[)]" -r --include="*.R" | grep -F
>>"/R/" | wc
>> 59 3075021
>
>Beautiful use of 'grep' -- thank you for those above, as well.
>It does need a quick manual check, but if I use the above grep
>from E
, March 13, 2018 12:14 PM
To: Doran, Harold
Cc: Martin Morgan ; r-help@r-project.org
Subject: Re: [R] Possible Improvement to sapply
Could your code use vapply instead of sapply? vapply forces you to declare the
type and dimensions
of FUN's output and stops if any call to FUN does not matc
You’re right, it sure does. My suggestion causes it to fail when simplify =
‘array’
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Tuesday, March 13, 2018 12:11 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Possible Improvement to sapply
Wouldn't that chang
izable way.
-Original Message-
From: Martin Morgan [mailto:martin.mor...@roswellpark.org]
Sent: Tuesday, March 13, 2018 9:43 AM
To: Doran, Harold ; 'r-help@r-project.org'
Subject: Re: [R] Possible Improvement to sapply
On 03/13/2018 09:23 AM, Doran, Harold wrote:
> While w
While working with sapply, the documentation states that the simplify argument
will yield a vector, matrix etc "when possible". I was curious how the code
actually defined "as possible" and see this within the function
if (!identical(simplify, FALSE) && length(answer))
This seems superfluous to
I know of no existing functions for estimating the parameters of this model
using MCMC or MML. Many years ago, I wrote code to estimate this model using
marginal maximum likelihood. I wrote this based on the using nlminb and
gauss-hermite quadrature points from statmod.
I could not find that c
The blog post that the vocal range directs to is *highly* offensive and off
color and in very poo taste to share with this group.
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Smith
(CDA) via R-help
Sent: Tuesday, January 09, 2018 12:47 PM
To:
?install.packages
On 8/18/17, 7:39 AM, "Lucy McMahon" wrote:
>I am hoping to run a generalised linear mixed effect model but I don't
>seem to have access to package lme4.
>
>
>library (lme4)
>Error in library(lme4) : there is no package called �lme4�
>
>
>I'm unsure of how to go about installing
I am writing a program where non-technical R users will read in a config file
and the config file will then parse the arguments found within the config and
pass them to respective functions. I'm having trouble (efficiently) writing a
piece of code to retain quotation marks around the argument wh
Im not sure if you’re asking a question or confirming that it works for you.
But, obviously, the code below behaves as expected
From: lily li [mailto:chocol...@gmail.com]
Sent: Tuesday, May 09, 2017 11:13 AM
To: Doran, Harold
Cc: Charles Determan ; R mailing list
Subject: Re: [R] About
?round
From: lily li [mailto:chocol...@gmail.com]
Sent: Tuesday, May 09, 2017 11:10 AM
To: Charles Determan
Cc: Doran, Harold ; R mailing list
Subject: Re: [R] About calculating average values from several matrices
Thanks very much, it works. But how to round the values to have only 1 decimal
orm(100), 10, 10)
}
### mean over all cells
sapply(myData, function(x) mean(x))
### mean over all columns
sapply(myData, function(x) colMeans(x))
From: lily li [mailto:chocol...@gmail.com]
Sent: Tuesday, May 09, 2017 10:44 AM
To: Doran, Harold
Cc: R mailing list
Subject: Re: [R] About cal
Are you trying to take the mean over all cells, or over rows/columns within
each dataframe. Also, are these different dataframes stored within a list or
are they standalone?
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of lily li
Sent: Tuesday, May 09
.
-Original Message-
From: Bruce Ratner PhD [mailto:b...@dmstat1.com]
Sent: Monday, April 10, 2017 2:13 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Too strange that I cannot install several packages
Dear Harold:
If you do not want to answer my questions, then do not reply.
Warmest
You really need to stop spamming this list and take time to learn R basics. You
sent me emails directly on this and asked me this specific question before.
These are not packages, but are functions and you do not work with R this way.
-Original Message-
From: R-help [mailto:r-help-boun.
Let's keep r-list on the email per typical protocol. Apply is a function in
base R, so you don't need to install it
-Original Message-
From: Bruce Ratner PhD [mailto:b...@dmstat1.com]
Sent: Friday, March 31, 2017 1:06 PM
To: Doran, Harold
Subject: Re: [R] Taking the sum of
Apologies, my code below has an error that recycles the vector x. Hopefully,
the concept is clear.
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold
Sent: Friday, March 31, 2017 12:34 PM
To: 'Bruce Ratner PhD' ; r-help@r-project.o
I do not believe this can be done in one step
dat <- data.frame(matrix(rnorm(50), 5))
pos <- c(1,3)
res <- apply(dat[, pos], 2, sum)
x <- numeric(5)
x[pos] <- res
rbind(dat,x)
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bruce Ratner PhD
Sent:
bels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
X <- model.matrix(lm.D9)
Xqr <- qr(X)
Q <- qr.Q(Xqr)
R <- qr.R(Xqr)
### this is same as just (X'X)^-1
chol2inv(R)
### Compared to the prior way I mentioned
solve(crossprod(X))
-Ori
A slightly more ³R-ish² way of doing
S <- solve(t(X)%*%X)
Is to instead use
S <- solve(crossprod(X))
And the idea idea of inverting the SSCP matrix only and not actually
solving the linear system is not so great, which is why it is better to do
as Rolf is suggesting and get all things you need
That is a helpful, and important, caveat. So, perhaps I should amend my
original question to ask something like is it safe *when* length(r1) ==
length(r2)
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Friday, December 09, 2016 1:27 PM
To: Doran, Harold
I believe I now see the light vis-à-vis iterators when combined with foreach()
calls in R. I have now been able to reduce computational workload to minutes
instead of hours. I want to verify that the way I am using them is "safe". By
safe I mean does the iterator traverse elements in the same wa
R-Help (and package author)
I'm trying to understand within the context of R what the benefit of using an
iterator is. My only goal in using the foreach package is to improve
computational speed with some embarrassingly parallel tasks I have to compute.
I took the example found at the link belo
[mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold
Sent: Saturday, December 03, 2016 4:26 PM
To: r-help@r-project.org
Subject: [R] error serialize (foreach)
I have a portion of a foreach loop that I cannot run as parallel but works fine
when serialized. Below is a representati
I have a portion of a foreach loop that I cannot run as parallel but works fine
when serialized. Below is a representation of the problem as in this instance I
cannot provide reproducible data to generate the same error, the actual data I
am working with are confidential.
Within each foreach lo
I am having tremendous fortune using the foreach function in the foreach
package sending work out to multiple cores in order to reduce computational
time.
I am experimenting with which types of tasks benefit from running in parallel
and which do not and so this is a bit of a learning experience
suggestions to those on this thread.
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Tuesday, November 08, 2016 5:14 PM
To: Doran, Harold
Cc: peter dalgaard ; r-help@r-project.org; Fox, John
Subject: Re: [R] Alternative to apply in base R
The version which allows any number of columns does
of columns in this matrix (plus another factor). But the number of columns
is never all that large.
On 11/8/16, 4:37 PM, "peter dalgaard" wrote:
>
>> On 08 Nov 2016, at 21:23 , Doran, Harold wrote:
>>
>> It¹s a good suggestion. Multiplication in this case is ove
negative and positive.
>
>I hope this helps,
> John
>-
>John Fox, Professor
>McMaster University
>Hamilton, Ontario
>Canada L8S 4M4
>web: socserv.mcmaster.ca/jfox
>
>
>________
>From: R-help [r-help-bo
Without reaching out to another package in R, I wonder what the best way is to
speed enhance the following toy example? Over the years I have become very
comfortable with the family of apply functions and generally not good at
finding an improvement for speed.
This toy example is small, but my
compared to the indexing method.
Perhaps I'm using it incorrectly?
-Original Message-
From: Constantin Weiser [mailto:constantin.wei...@hhu.de]
Sent: Wednesday, September 28, 2016 12:55 PM
To: r-help@r-project.org
Cc: Doran, Harold
Subject: Re: [R] Faster Subsetting
I just mod
Schneider [mailto:dosc3...@colorado.edu]
Sent: Wednesday, September 28, 2016 12:27 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Faster Subsetting
I regularly crunch through this amount of data with tidyverse. You can also try
the data.table package. They are optimized for speed
I have an extremely large data frame (~13 million rows) that resembles the
structure of the object tmp below in the reproducible code. In my real data,
the variable, 'id' may or may not be ordered, but I think that is irrelevant.
I have a process that requires subsetting the data by id and then
I have produced a terribly inefficient piece of codes. In the end, it gives
exactly what I need, but clumsily steps through multiple steps which I'm sure
could be more efficiently reduced.
Below is a reproducible example. What I have to begin with is character vector,
dimInfo. What I want to do
memoise_1.0.0 stringi_1.1.1 stringr_1.1.0 digest_0.6.10
-Original Message-
From: Michael Friendly [mailto:frien...@yorku.ca]
Sent: Thursday, September 08, 2016 9:19 AM
To: Doran, Harold ; r-help@r-project.org
Cc: Duncan Murdoch
Subject: Re: R-specific Software Requirement Specificat
output etc.
I suppose it is easy enough to add an "inherits from" or outputs an object of
class "xyz" to this for my purpose.
-Original Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Sent: Wednesday, September 07, 2016 12:46 PM
To: Doran, Harold ;
I use Mercurial for this.
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rich Shepard
Sent: Wednesday, September 07, 2016 11:56 AM
To: r-help@r-project.org
Subject: Re: [R] R-specific Software Requirement Specification
On Wed, 7 Sep 2016, Doran
I'm building a large program with many different people contributing to the
coding in R and so it needs a well-articulated design spec. The program will
have many different functions that must interact with each other, but the
individual functions will be written by different people.
I'm curiou
You should ask this on the Shiny google group. But, Shiny depends on R, so
what you¹re wanting to accomplish is not possible
On 8/16/16, 9:11 AM, "Venky" wrote:
>Hi,
>
>How to run Shiny (Server,UI) into JAVA?
>
>I am running R Shiny app using R
>But i want to run those functions in Java without
Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Sent: Tuesday, June 07, 2016 10:44 AM
To: Doran, Harold ; r-help@r-project.org
Subject: Re: [R] Faster Multivariate Normal
On 07/06/2016 9:06 AM, Doran, Harold wrote:
> I am computing a complex multidimensional integral
I am computing a complex multidimensional integral (4 dimensions) using
Gauss-legendre and am looking to optimize one piece of code that is currently
very expensive. The integral is evaluated for K individuals in my data and once
this piece is computed it can be stored and recycled over all K in
You asked this question yesterday, and received responses on this same
response. Is there a reason this is reposted?
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen
Sent: Wednesday, May 04, 2016 1:46 AM
To: r-help
Subject: [R] Grep command
Michael
It is not possible to answer this question without seeing reproducible code.
More importantly, it is better to ask Shiny-related questions on stackoverflow
using the Shiny tag or on the Shiny google group.
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] O
(adding R mixed group). You actually do not want to do this test, and there is
no "shrinkage" here on these variances. First, there are conditional variances
and marginal variances in the mixed model. What you are have below as "A" is
the marginal variances of the random effects and there is no
> Yes, and I think that the suggestion in another post to look at censored
> regression is more in the right direction.
I think this is right and perhaps the best (or at least better) pathway to
pursue than considering this within the framework of measurement error (ME). Of
course there *is* M
I�m struggling a bit with learning about POSIX objects to do some basic things
with objects of this class. Suppose I have the following simple example
times <- c("03:20", "29:56", "03:30", "21:03", "56:26")
aa <- strptime(times, "%M:%S�)
I can do means, and some other basic things, but I cannot
Below is some working code that, generally speaking, accomplishes why I want,
but am looking for a necessary improvement in the final step. The code below
scrapes data from a website (thousands of pages actually) and organizes
athlete�s scores in a data frame. The final variable, called Workout0
I�m dealing with an issue that is seemingly simple, and I�m sure there is an
obvious solution. I�m writing a wrapper function that calls functions from
another package (twitteR).
However, the function I happen to be using in that package prompts the user the
user to enter a �1� or a �2� in the
I am trying to replicate the twitter and word cloud example found here
https://sites.google.com/site/miningtwitter/questions/talking-about/wordclouds/wordcloud1
When implemented verbatim, I replicate results and all works fine. But, when I
make a slight modification to the code it fails in creat
[mailto:h.wick...@gmail.com]
Sent: Monday, March 02, 2015 2:05 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] readHTMLTable() in XML package
This somewhat simpler rvest code does the trick for me:
library(rvest)
library(dplyr)
i <- 1:10
urls <- paste0('http://games.crossfit.
I'm having trouble pulling down data from a website with my code below as I
keep encountering the same error, but the error occurs on different pages.
My code below loops through a wensite and grabs data from the html table. The
error appears on different pages at different times and I'm not sur
Is there functionality within R proper, without having to revert to the OS,
allowing a function or a portion of an R script to be run at a defined time? My
google searches haven't provided much other than one at the link below which
relies on an OS.
Thanks,
Harold
https://tgmstat.wordpress.com
opt
#list("coefficients" = opt$par, "LogLik" = -opt$value,
"Std.Error" = sqrt(diag(solve(opt$hessian
}
dat <- replicate(20, sample(c(0,1), 2000, replace = T))
r2 <- pl2(datat, Q =10)
-Original Message-
From: Prof J C Nash
I am trying to generalize a working piece of code for a single parameter to a
multiple parameter problem. Reproducible code is below. The parameters to be
estimated are a, b, and c. The estimation problem is such that there is one set
of a, b, c parameters for each column of the data. Hence, in
I found a google user group for shiny, and am curious if there is an SIG as
well. Didn't see one in my searches, but looking for an active place to ask
questions and share code.
Thanks.
[[alternative HTML version deleted]]
__
R-help@r-project
That seems to have worked, both in the new and old version of R. I'll do more
unit testing on other files.
Thank you, Gabor.
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Wednesday, February 11, 2015 10:22 AM
To: Doran, Harold
Cc: r-h
I have a function written and tested using R 3.0.1 and sqldf_0.4-7.1 that works
perfectly. However, using this same code with R 3.1.2 and sqldf_0.4-10 yields
the error below that I am having a difficult time deciphering. Hence, same code
behaves differently on different versions of R and sqldf()
?uniroot
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ssuhanchen
Sent: Tuesday, February 10, 2015 3:32 AM
To: r-help@r-project.org
Subject: Re: [R] How to solve this complex equation
no, it is not my homework.
I would like to know if there is relevant
Daniel
Lmer has never returned p-values from a model summary; this is a well-known and
discussed issue. You must have post-processed the data in some way to get the
p-values.
Our only way of helping is for you to provide sample code on what you did
-Original Message-
From: r-help-boun.
I am dealing with data frames that have thousands of columns and hundreds of
thousands of rows and only need a few specific columns from the data. The data
take various formats, but normally are tab-delimited.
I have written the following which is working as expected. However, because I�m
so ne
from fixed")
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Monday, September 15, 2014 12:42 PM
To: Doran, Harold
Cc: r-help@r-project.org
Subject: Re: [R] Using sqldf() to read in .fwf files
On Mon, Sep 15, 2014 at 12:09 PM, Doran, Harold wro
I am learning to use sqldf() to read in very large fixed width files that
otherwise do not work efficiently with read.fwf. I found the following example
online and have worked with this in various ways to read in the data
cat("1 8.3
210.3
319.0
416.0
515.6
719.8
", file = "fixed")
fixed <- file
I have done an embarrassingly bad job using a mixture of gsub and strsplit to
solve a problem. Below is sample code showing what I have to start with (the
vector xx) and I want to end up with two vectors x and y that contain only the
digits found in xx.
Any regex users with advice most welcome
I need to send a system command to another program from within R but have a
small hangup
I'm trying to do something like this
system("notepad myfile.txt")
But, more generally this is happening to multiple files, so I loop over
thousands of files. For purposes of an example, my code is somethin
I have working code to write a file out as fwf as shown below. I have one
question to try and automate this I cannot get to work.
I am generating thousands of data files for a simulation to be run outside of R
and each file varies in its dimensions. So I am trying to write code that can
write t
I am trying to generate a binary matrix where every row in the matrix is
guaranteed to have at least one 1. Ideally, I would like most rowSums to be
equal to 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0.
I can tinker with the vector of probability weights, but in doing so
Is the time and date package the right one to convert a vector, such as the
following, into a time format?
"12:06" "11:51" "11:53" "12:27" "14:20" "12:27"
The aim is to deal with a time variable numerically (find means, etc).
Thanks
Harold
[[alternative HTML version deleted]]
___
Suppose I have a character vector as follows:
> aa
[1] "1 (472)" "2 (445)" "3 (431)" "3 (431)" "5 (415)" "6 (405)" "7 (1)
I want to extract the values within parentheses and place them into a column
that is numeric. The values in aa vary in length and so using strsplit() wont
work because the
s=0&showathleteac=1&athletename="
>data <- readHTMLTable(readLines(url), which=1, header=TRUE)
>
>names(data) <- gsub("\\n", "", names(data))
>names(data) <- gsub(" +", "", names(data))
>
>data[] <- lapply(data, func
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
A fast computation I use is based on the following:
A <- matrix(rnorm(16), ncol = 4)
B <- matrix(rnorm(16), ncol = 4)
C <- A %*% B
sum(diag(C))
### This is less expensive to compute when the matrix multiplication is
expensive
sum(A * t(B))
So, it just uses the elementwise calculations and sums
Rachel
Using fix() is not really a good way to view or modify your data. It is better
to use functions like head(), tail() or index values in the dataframe to view
your data and then also modify elements through indexing.
For instance, something like this
> tmp <- data.frame(v1 = rnorm(10), v
Suppose I have three matrices, such as the following:
mat1 <- Matrix(rnorm(9), 3)
mat2 <- Matrix(rnorm(9), 3)
mat3 <- Matrix(rnorm(9), 3)
I now need to column bind these and I could do the following if there were only
two of those matrices because cbind2() has an x and y argument
Zlist <- c(mat
simon.hayw...@infinitycloud.com]
Sent: Thursday, November 07, 2013 11:59 AM
To: Doran, Harold; 'Eckstädt, Elisabeth'; r-help@R-project.org
Subject: RE: strange behaviour when subsetting a data.frame
So is there a way to make the subsetting behave as expected?
-Original Message---
Yes, but notice that
man2[3,] == .3
[1] FALSE
This is because of issues of machine precision when dealing with floating
points, not a problem in R. Comparisons for nearly equivalent numbers are done
using all.equal() as shown below.
> all.equal(man2[3,], .3)
[1] TRUE
-Original Message
Well, see the help page for by() or an apply() function. But, YIKES, maybe work
with a statistician who can help you with the underlying issue.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Valeria Muzzolini
Sent: Monday, Octobe
Chapter 7 of Writing R Extensions
http://cran.r-project.org/doc/manuals/R-exts.html#Generic-functions-and-methods
-Original Message-
From: gret...@gmail.com [mailto:gret...@gmail.com] On Behalf Of Grant Rettke
Sent: Tuesday, October 08, 2013 4:31 PM
To: Doran, Harold
Cc: r-help@r
The Writing R Extensions guide has a good section on writing generic functions
and methods. However, has anyone generated any additional tutorials,
presentations, notes, etc that extend this topic?
Perhaps showing additional examples of what works well and what risks to avoid.
Thanks,
Harold
I have a function for fitting a type of linear regression and have written
methods for it as shown below. I exclude the main lm.eiv.fit function as it is
large and I don't think necessary for the reproducible example. But, I can
certainly provide if that would be needed.
These methods allow for
Do your matrices have any special properties we should know about? For example,
are they sparse, symmetric, diagonal, etc?
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Praveen Surendran
Sent: Wednesday, August 14, 2013 11:41 AM
What about something like this:
tmp <- data.frame(var1 = rnorm(36), ind = gl(6,6))
with(tmp, tapply(var1, ind, mean))
You can see that your version of
mean(tmp[1:6,c("var1")])
gives the same as mine for the first 6 rows.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r
1 - 100 of 343 matches
Mail list logo