Displaying 20 results from an estimated 300 matches similar to: "need help"
2012 Jun 12
4
How to index a matrix with different row-number for each column?
here's my question: suppose I have a matrix:
mt<-matrix(1:12,ncol=6)
now I have a vector
vt<-c(1,2,2,2,1,2)
which means I want to get:
the 1st row for column1;
the 2nd row for column2;
the 2nd row for column3;
the 2nd row for column4;
...
that what I want is this vector:
1,4,6,8,9,12
Does anyone know how to do this fast?
I know I can use for-loop to travel all columns,but
2012 Jun 12
1
Analyzing large files faster
I'm trying to analyze the following data set (sample):
"ID" "adj.P.Val" "logFC" "Gene.symbol"
"1419156_at" "5.32e-12" "2.6462565" "Sox4"
"1433575_at" "5.32e-12" "3.9417089" "Sox4"
"1428942_at" "2.64e-11"
2004 Apr 16
3
R-1.9.0: make error on slackware-current!
My box: Slackware-current, Xfree 4.4.
ERROR as follows:
gcc -I. -I../../../src/include -I../../../src/include -I/usr/X11R6/include
-I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -mieee-fp -fPIC
-g -O2 -c dataentry.c -o dataentry.lo
In file included from dataentry.c:31:
/usr/X11R6/include/X11/Xlib.h:1390: error: parse error before "_Xconst"
2001 Jun 05
2
a bug? (PR#968)
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Dear R,
I would like to report what I think is a bug in R. I am running R
within emacs on a Digital AlphaStation. See the version information
at the end of my R session for details. I also attach a copy of the
file that is read in the `read.table' command.
Here's my R session, with a few
2007 Mar 05
1
Matrix/dataframe indexing
Hi all,
I am hoping someone can help me out with this:
If I have dataframe of years and ages and the first column and first row
are filled with leading values:
Df<- age1 age2 age3
Yr1 1 0.4 0.16
Yr2 1.5 0 0
Yr3 0.9 0 0
Yr4 1 0 0
Yr5 1.2 0 0
Yr6 1.4 0 0
Yr7 0.8 0 0
Yr8 0.6 0 0
Yr9 1.1 0 0
Now the rest of the cells need to be filled according to the previous
year and age
2013 Jan 20
2
Lattice levelplot- remove unused levels per panel
Hi,
I am using levelplot, and would like remove from each panel (condition) its
unused x levels.
e.g.
Remove from panel vs=1 the cyl level=8.
data(mtcars)
levelplot(mpg~factor(cyl)*factor(gear)|factor(vs))
Thanks for your help,
Ronny
--
View this message in context: http://r.789695.n4.nabble.com/Lattice-levelplot-remove-unused-levels-per-panel-tp4656087.html
Sent from the R help mailing
2014 Sep 01
2
[PATCH 1/3] nv50: set the miptree address when clearing bo's in vp2 init
The mt address is about to be used more, make sure it's set
appropriately.
Reported-by: Emil Velikov <emil.l.velikov at gmail.com>
Tested-by: Emil Velikov <emil.l.velikov at gmail.com>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable at lists.freedesktop.org>
---
src/gallium/drivers/nouveau/nv50/nv84_video.c | 2 ++
1 file
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2013 Jul 04
2
how to choose dates data?
i have converted my data into date format like below:
> day=as.Date(originaldate,"%m/%d/%Y")
> day[1:5]
[1] "2008-04-12" "2011-07-02" "2011-09-02" "2008-04-12" "2008-04-12"
I wish to select only those observations from 2007 to 2009, how can I
select from this list?
[[alternative HTML version deleted]]
2023 Jan 14
1
Removing variables from data frame with a wile card
You rang sir?
library(tidyverse)
xx = 1:10
yr1 = yr2 = yr3 = rnorm(10)
dat1 <- data.frame(xx , yr1, yr2, y3)
dat1 %>% select(!starts_with("yr"))
or for something a bit more exotic as I have been trying to learn a bit
about the "data.table package
library(data.table)
xx = 1:10
yr1 = yr2 = yr3 = rnorm(10)
dat2 <- data.table(xx , yr1, yr2, yr3)
dat2[, !names(dat2)
2007 Jun 06
1
fixed effects anova in lme lmer
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a
random effect, or have there be at least one random effect in order for these
functions to work?
Trying to run such, (1) without specifying a random effect produces an error,
(2) specifying that there is no random effect does not produce the same output
as an anova run in lm(); (2b) specifying that there is no
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I want to extract only those columns
> that are numeric(double) or integer to do
2023 Nov 02
4
Sum data according to date in sequence
Dear all,
I have this set of data. I would like to sum the EnergykWh according date
sequences.
> head(dt1,20) StationName date time EnergykWh
1 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 12:09 4.680496
2 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 19:50 6.272414
3 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 20:22 1.032782
4 PALO ALTO CA / CAMBRIDGE #1 1/15/2016 8:25 11.004884
5
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after?
library(tidyverse)
library(lubridate)
input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
> dt1 <- as.Date("2004-12-31")
> dt2 <- as.Date("2005-12-31")
> seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month")
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D
2006 Sep 20
1
Simulation help
I'm trying to simulate trend data over a five year period. I want
different trend profiles...the simplest being a linear trend. I've been
using the following code:
patBdta1 <- NULL
for(i in 1:100)
patBdta1 <- rbind(patBdta1,c(yr1= mean(rbinom(50,1,.50)),
yr2 =mean(rbinom(50,1,.51)),
yr3 =mean(rbinom(50,1,.52)),
2011 May 10
1
Saving multiple 3x3 TIFF graphics inside a loop
Dear Friends,
I have been trying to save multiple 3x3 (mfrow=c(3,3) graphics inside a loop
using tiff figure format (not using PDF or savePlot functions) with no
success. Could you please help?
Here is a simplified example code:
dat=data.frame (ID=rep(1:10,each=10),IDV=rep(seq(1:10),times=10))
dat$DV <- with(dat, 50+15*IDV)
dat=dat[order(dat$ID,dat$IDV),]
for(i in 1:10){
dt1 =
2008 May 08
2
Microseconds for a zoo object?
Hello
I have a string which contains microseconds, can anyone help on
constructing this in to a time object, with the microseconds, that I can
take to a ZOO file?
Thanks
Sean
> UK[1,3]
[1] "17:09:53.824"
> UK[1,1]
[1] "2007-12-11 00:00:00"
> mydates <- paste( substr(UK[,1], 1, 10), UK[,3])
> mydates[1]
[1] "2007-12-11 17:09:53.824"
>
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel,
I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000