Displaying 20 results from an estimated 100 matches similar to: "how to get perfect fit of lm if response is constant"
2005 Aug 23
2
merge list entries
dear expeRts,
i would like to merge the data frame entries in a list. for example:
> #input
> myl <- list(q1=data.frame(id=c("Alice", "Bob"), grade=c(90, 49)),
q2=data.frame(id=c("Alice", "Chuck"), grade=c(70, 93)),
q3=data.frame(id=c("Bob", "Chuck"), grade=c(84, 40)))
> #output
> (mydf <-
2018 May 25
0
how to make the code more efficient using lapply
Hi Stephen,
I am not sure that the "for loop" is the source of slowness.
You seem to be doing a lot of unnecessary work each time through the loop.
e.g. no need to check if it's the last file, just move that section outside
of the loop.
It will be executed when the loop finishes. As it is you are calling
list.files() each time
through the loop which could be slow.
In any case
2011 Jan 20
1
syntax for a list of components from a list
I'm attempting to generalise a function that reads individual list components, in this case they are matrices, and converts them into 3 dimensional array. I can input each matrix individually, but want to do it for about 1,000 of them ...
This works
array2 <- abind(list1[[1]],list1[[2]],list1[[3]],along=3)
This doesn't
array2 <- abind(list1[[1:3]],along=3)
This doesn't either
2018 May 25
1
how to make the code more efficient using lapply
Eric's approach seems reasonable to me, and I agree that it's probably not the use of a "for" loop that makes the original version slow. As Eric mentioned, there are lots of unnecessary things happening in the loop.
For example, list.files() was called twice inside the loop, which is unnecessary, and will definitely slow the loop down (though probably not by much). Call it
2018 May 25
2
how to make the code more efficient using lapply
Dear All,
I have a following for-loop code which is basically intended to read in
many excel files (each file has many columns and rows) in a directory and
extract the some rows and columns out of each file and then combine them
together into a dataframe. I use for loop which can do the work but quite
slow. How to make it faster using lapply function ? Thanks in advance!
temp.df<-c() #
2004 Aug 25
3
Beginners Question: Make nlm work
Hello,
I'm new to this and am trying to teach myself some R by plotting
biological data. The growth curve in question is supposed to be fitted
to the Verhulst equation, which may be transcribed as follows:
f(x)=a/(1+((a-0.008)/0.008)*exp(-(b*x)))
- for a known population density (0.008) at t(0).
I am trying to rework the example from "An Introduction to R" (p. 72)
for my case and
2015 Mar 12
3
location of dovecot.rawlog-directory
How is it possible to have the dovecot.rawlog-directory outside the
mail_location? A link to another directory is not because it is checked
in rawlog.c S_ISDIR to directory.
2016 Dec 09
4
[Bug 1101] New: SET target unreliable in iptables - add does not work as expected
https://bugzilla.netfilter.org/show_bug.cgi?id=1101
Bug ID: 1101
Summary: SET target unreliable in iptables - add does not work
as expected
Product: netfilter/iptables
Version: unspecified
Hardware: x86_64
OS: Debian GNU/Linux
Status: NEW
Severity: major
Priority: P5
2007 Apr 20
2
R in cron job: X problems
I'd like to use an R CMD BATCH script as part of a chron job that is set
up to run every hour.
The trouble is that the script creates a graphical output in a file via
png(), and apparently this in turn works through X.
When cron invokes the job, no X server is available -- I suppose that
the DISPLAY variable is not set -- and so R exits with an error message
in the output file. (If I run the
2014 Apr 18
1
Samba AD Setup report (success)
Hi Samba-Team,
you wrote that you'd like to hear from users, so here I go ...:
I was just following your samba wiki on how to implement a new AD domain on an open Suse 12.3 using the Sernet rpm.
The documents are very precise, easy to understand and follow. Especially, the example makes it easy to understand.
Two things that I have/had a little difficulties with:
1) In your example,
2014 Mar 24
1
Weird Authentication behaviour
Hi guys,
we use dovecot 2.0.9 and authentication against a mysql database. Everything
works fine, but we found some weird behavior ? when the password is e.g.
?testpass? you also authenticate successfully with ?testpass123? or
?testpassNOT?. Whatever comes after the correct password doesn?t matter, the
authentication is still successful.
Here are the used configs:
// auth-sql.conf.ext
2015 Mar 12
0
location of dovecot.rawlog-directory
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 12 Mar 2015, Hardy Flor wrote:
> How is it possible to have the dovecot.rawlog-directory outside the
> mail_location? A link to another directory is not because it is checked in
> rawlog.c S_ISDIR to directory.
Patch rawlog.c and recompile. :)
- --
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
2010 Jan 16
1
Sweave - How to use local objects in code chunks
Hello,
I wrote a function create_report that calls the function Sweave.
create_report shall be used to create a pdf-report about an lm-Object which
is passed as an argument to create_report.
I try to use an object sel_model, that is created within the function
environment of create_report and later on used within the first code chunk
of the file report_template.rnw.
When I use following code I
2010 May 20
6
writing function
Dear group,
I am trying to write functions, but as a beginner, everything is not so
obvious.
Let's say I want the results in a list of elemts like this :
tot1, tot2, etc
Here is a function:
toto <-
function(x,y)
{
for(i in x:y){
paste(c("tot",i),collapse="")<-(i*2)
}
}
If I type this :
>toto(1,5)
I get this message error:
Error in paste(c("tot",
2018 Feb 16
9
Ubiquiti Model UAP-AC-PRO
Everyone,
Have any of you installed ubiguiti wireless routers on your network?
It looks like the setup requires the use of software; they have some
packages that are ready made for Ubuntu and Debian, but not RedHat
https://www.ubnt.com/download/unifi/unifi-ap-ac-pro
Have any of you tried or succeeded in installation this on Centos 7.4?
Greg Ennis
2017 Sep 05
4
Interesting behavior of lm() with small, problematic data sets
I've recently come across the following results reported from the lm() function when applied to a particular type of admittedly difficult data. When working with
small data sets (for instance 3 points) with the same response for different predicting variable, the resulting slope estimate is a reasonable approximation of the expected 0.0, but the p-value of that slope estimate is a surprising
2014 May 20
1
[patch] Add support for editor function in edit.default
Regarding the following extract of ?options:
?editor?: a non-empty string, or a function that is called with a
file path as argument.
edit.default currently calls the function with three arguments: name,
file, and title. For example, running the following
vimCmd <- 'vim -c "set ft=r"'
vimEdit <- function(file_) system(paste(vimCmd, file_))
options(editor =
2009 Mar 11
1
Easy "Recall" to get ls(..., all.names=TRUE)?
Dear useRs,
I have a utility function which is meant to be a clone of ls(), except
with the option all.names=TRUE. Currently however, the function merely
consists of a copy of the source code of ls(), except the default value
of all.names is different. That approach has the drawback of future
inconsistency if the code for ls() ever changes. No comment on whether
that is likely or not; I would
2017 Sep 05
0
Interesting behavior of lm() with small, problematic data sets
Tim,
I think what you're seeing is
https://en.wikipedia.org/wiki/Loss_of_significance.
Cheers,
Mark
From: "Glover, Tim" <Tim.Glover at amecfw.com>
To: "r-help at r-project.org" <r-help at r-project.org>
Date: 09/05/2017 11:37 AM
Subject: [R] Interesting behavior of lm() with small, problematic
data sets
Sent by: "R-help"
2011 Nov 15
3
Question about linear regression in R
Hi all,
I wrote a r program as below:
x <- 1:10
y <- c(3,3,3,3,3,3,3,3,3,3)
fit <- lm(log(y) ~ x)
summary(fit)
And I expect to get some error message from R, because "y" is constant.
But, I got the message as below:
> summary(fit)
Call:
lm(formula = log(y) ~ x)
Residuals:
Min 1Q Median 3Q Max
-6.802e-17 -3.933e-17 -1.063e-17 1.807e-17