Displaying 20 results from an estimated 900 matches similar to: "how to make the code more efficient using lapply"
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
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
2011 Sep 21
1
Problem indexing a factor variable
Hi,
I have a dataframe "gexp_1" with 115 rows of samples and 27000 columns of gene expression measurements with each column corresponding to one gene. I now have a smaller vector of genes "tp" for which I need to pull out the data form the data frame.
# first gene from the list with 16 genes
x <- tp[1,]
x
[1] geneA
16 Levels: geneA, geneB...
#unsuccessful
gexp_1$x
NULL
2008 Feb 06
1
Histogram/Bar plot graph
Hi,
I have the following data:
> Myvalues
Gene ES MEF Embryo ESHyp
1 GeneA -0.38509507 0.00 1.6250 1.7039921
2 GeneB 0.06262914 0.00 1.6250 -0.272033
and so on...
I want to plot the expression values of GeneA and GeneB in the
different cell/embryo/conditions (columns 2:5 above). Now, if I do:
>library(ggplot2)
> qplot(x=Gene, Embryo, geom =
2011 Mar 23
1
how to add in interaction terms in gamm
I want to use gamm to generate smoothed trend line for three groups
identified by dummy variable genea and geneb. My question is how to add in
an interaction term between the time and another dummy variable such as
gender?
fitm<-gamm(change_gfr~
genea+geneb+s(timea_n,bs="ps")+s(timeb_n,bs="ps")+s(timec_n,bs="ps"),data=mm,random=list(time_n=~1|PID))
--
View this
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 <-
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
2010 Jan 08
2
how to get perfect fit of lm if response is constant
Hello.
Consider the response-variable of data.frame df is constant, so analytically
perfect fit of a linear model is expected. Fitting a regression line using
lm result in residuals, slope and std.errors not exactly zero, which is
acceptable in some way, but errorneous. But if you use summary.lm it shows
inacceptable error propagation in the calculation of the t value and the
corresponding
2008 Aug 07
1
Mtext doesn't display characters in italic when I use a greek symbol
Following on from my previous mail!
plot(1:10,1:10)
mtext("title", side=3, adj=0, font=3, cex=1.5)
This works as expected and puts the font in italics.
tag <- "A)"
suffix <- "genea::"
plot(1:10,1:10)
mtext(bquote(.(tag) ~ Delta * .(suffix)), side=3, adj=0, font=3,
cex=1.5)
Here, the font isn't in italics, it's normal.
I presume this is some
2014 Jan 10
2
EFI build problems
On Fri, Jan 10, 2014 at 2:53 AM, Ferenc Wagner <wferi at niif.hu> wrote:
> Gene Cumm <gene.cumm at gmail.com> writes:
>
>> On Sat, Jan 4, 2014 at 6:39 AM, Gene Cumm <gene.cumm at gmail.com> wrote:
>>> On Tue, Dec 17, 2013 at 8:39 AM, Ferenc Wagner <wferi at niif.hu> wrote:
>>>
>>>> * make spotless still fails after working around
2013 Dec 01
1
[PATCH] efi: reuse UDP port with sendto
On Nov 30, 2013 7:33 PM, "Geert Stappers" <stappers at stappers.nl> wrote:
>
> Op 2013-11-30 om 13:12 schreef Gene Cumm:
> <bigsnip/>
> >
> > Is there any chance you two could try my branch efi-fixes (commit
> > d04b0edf) as I believe this solves the issues of the changing
> > StationPort and routing difficulties of both a single subnet and
2007 Jul 26
4
Finding matches in 2 files
I have 2 files containing data analysed by 2 different methods. I would like to find out which genes appear in both analyses. Can someone show me how to do this?
_________________________________________________________________
[[trailing spam removed]]
[[alternative HTML version deleted]]
2015 Jul 31
2
EFI: HP + syslinux = crash
> 5) upload handles.txt somewhere
It's waiting at http://okkie.nu/tmp/handles.txt
2020 Oct 23
1
openxlsx::read.xlsx can't read data without a header
Hi,
I try to read 6 rows (from 5th to 10th) from Excel, but I can always get
5. The first row of the 6 becomes the header. How can I add something like
"header = FALSE" in the formula, so that the resulting data would be all
the 6 rows? A similar problem occurs in readxl::read_xlsx. Thank you!
> temp <- openxlsx::read.xlsx(fl_trilem_sgko, sheet="Korea", rows=5:10,
2015 Oct 02
6
UEFI: Failed to load ldlinux.e64/ldlinux.e32
I have a patch that I think may help your situation of syslinux.efi
being unable to load ldlinux.e64/ldlinux.e32 (though I don't know if
any of you are using an EFI ia32 platform).
The basics are that we try to enable UseDefaultAddress as it helps
certain clients with routing and works on numerous other clients. If
we timeout on receiving a packet and have never received any packets,
disable
2023 Jan 16
1
Reg: Frequency in declaring time series data
Dear All,
I have a time series daily data with date are stored ( %dd-%mm-%yy format )
from 22-01-20 to 03-08-21. In total I have 560 observations. I am using the
following command to declare as a time series object. Here the the data set
is 7 days a week.
oil <- read_xlsx("crudefinal.xlsx")
pricet=ts(oil$price, start = c(2020, 22), freq = 365)
2015 Jul 18
5
[PATCH] Updated udp.c to use real client ip and subnetmask values if on local subnet
On Wed, Jul 8, 2015 at 7:34 PM, Gene Cumm <gene.cumm at gmail.com> wrote:
> What about the observed symptoms? Have you performed an inline packet
Jeff, there's specific code that creates specific responses that if
you had mentioned what you saw, I'd expect we could have seen
something sooner.
--
-Gene
2015 Jan 01
2
efi build dependent on git update
Happy New Year!
On Tue, Dec 30, 2014 at 05:29:29PM +0100, Geert Stappers wrote:
> On Tue, Dec 30, 2014 at 09:34:57AM -0500, Michael Sumulong wrote:
> > On Mon, Dec 29, 2014 at 8:36 PM, Gene Cumm wrote:
> > >
> > > 1) patch to not call git when not present has been prepared for after
> > > 6.03 along with multiple other patches.
> >
> > 1) Sorry I
2016 Mar 20
3
[PATCH 0/1] EFI image booting capabilities
>>>
<syslinux at zytor.com> wrote:
> This patch adds to the core EFI image booting capabilities.
> It was tested on VMware EFI clients and HP Elitebook EFI notebooks,
> only on PXE environments but it should work on non-PXE scenarios as well.
>
> Feedback appreciated.
If you've made any changes to this, I'd definitely like to see it. If
you have any
2013 Nov 10
2
syslinux.efi pxeboot across multiple subnets
On Sat, Nov 9, 2013 at 9:22 AM, Jason Matthews
<jason.david.matthews at gmail.com> wrote:
> The setup I was using was in a chassis. Slot 8 of the chassis is the client
> machine. It goes through Switch 1 (a Brocade switch) to the top of rack
> (BNT). The mirror is in the chassis switch. Slot 3 of the same chassis is
> connected to the mirror port in Switch 1.
>
> client =