On Sat, 22 May 2010, Waverley @ Palo Alto wrote:
Hi,
I am thinking about using R to create a database, then create table in
MySQL server. Can I do that using RMySQL package?
Maybe: it is done by SQL commands which you can use *if* you have the
correct privileges.
However, this is R-help,
Hi,
I have a list of 100, each list has 20 elements, and I would like to
select the first 7 elements in each list.
Let's take the alphabet as an example.
x - lapply(1:100, function(i) sample(LETTERS))
I tried x[[1:7]], but it doesn't work. Can anyone enlighten me on how
to do such selections?
Sorry - I figured that this to be a more common defined error than anything
specific to the data/function... Thanks for looking at this.
The data and function are below. Creating a single line of the data.frame at
a time will work (i.e. fold(s))
For multiple line data.frames, an error is
Might there be a limit ?
c - matrix(1:1, ncol=200)
dim(c)
[1] 50200
c - matrix(1:10, ncol=200)
Error: cannot allocate vector of size 3.7 Gb
-
A R learner.
--
View this message in context:
Hi,
I am trying to implement Higham's algorithm for correcting a non positive
definite covariance matrix.
I found this code in R:
http://projects.cs.kent.ac.uk/projects/cxxr/trac/browser/trunk/src/library/Recommended/Matrix/R/nearPD.R?rev=637
I managed to understand most of it, the only line I
I have a large csv table I am trying to read into R. I would like each
column to be of type factor. However, most columns have only numeral
entries (e.g. likert scales), so are automatically imported as type
numeric. Is there a way to convert ALL columns to be of type factor,
without having to
Kang Min wrote:
Hi,
I have a list of 100, each list has 20 elements, and I would like to
select the first 7 elements in each list.
Let's take the alphabet as an example.
x - lapply(1:100, function(i) sample(LETTERS))
I tried x[[1:7]], but it doesn't work. Can anyone enlighten me on how
to do
[ is a function, and you want to use it on each element of the list,
so...
lapply(x, [, c(1:7))
and the call to c() is of course not necessary, since : will generate a
vector.
__
R-help@r-project.org mailing list
Hello All,
sample() only sample on one variable x. But I'm interested in sampling
more than one variable without replacement.
Suppose I have 3 vectors x, y, z. I want to draw samples from all
three vectors such that the combination of the three elements in each
draw is not the same as any
Caitlin Sadowski wrote:
I have a large csv table I am trying to read into R. I would like each
column to be of type factor. However, most columns have only numeral
entries (e.g. likert scales), so are automatically imported as type
numeric. Is there a way to convert ALL columns to be of type
Thanks a lot, it works!
On May 23, 3:10 pm, Erik Iverson er...@ccbr.umn.edu wrote:
[ is a function, and you want to use it on each element of the list,
so...
lapply(x, [, c(1:7))
and the call to c() is of course not necessary, since : will generate a
vector.
Hello,
sedm1000 wrote:
Sorry - I figured that this to be a more common defined error than anything
specific to the data/function... Thanks for looking at this.
The data and function are below. Creating a single line of the data.frame at
a time will work (i.e. fold(s))
For multiple line
thmsfuller...@gmail.com wrote:
Hello All,
sample() only sample on one variable x. But I'm interested in sampling
more than one variable without replacement.
Suppose I have 3 vectors x, y, z. I want to draw samples from all
three vectors such that the combination of the three elements in each
This might help, depending on your exact needs:
v1 - sample(letters[1:2], 10, replace=TRUE)
v2 - sample(letters[3:4], 10, replace=TRUE)
v3 - sample(letters[5:6], 10, replace=TRUE)
aa - data.frame(v1=v1, v2=v2, v3=v3)
aa
v1 v2 v3
1 a d e
2 a d e
3 a c e
4 b d e
5 b d f
You are trying to create an object with 1G elements. Given that these
are integers, this will require about 4GB of space. If you are
running on a 32-bit system, which has a total phyical limit of 2-3GB
depending on what options you are running (at least on Windows), then
you have exceeded the
On 2010-05-23 0:56, john smith wrote:
Hi,
I am trying to implement Higham's algorithm for correcting a non positive
definite covariance matrix.
I found this code in R:
http://projects.cs.kent.ac.uk/projects/cxxr/trac/browser/trunk/src/library/Recommended/Matrix/R/nearPD.R?rev=637
I managed to
Hello Jim,
It sounds like a good time to go read about the packages
bigmemory
and/or
ff
Best,
Tal
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) |
On Sun, 2010-05-23 at 00:56 -0700, dusadrian wrote:
This might help, depending on your exact needs:
v1 - sample(letters[1:2], 10, replace=TRUE)
v2 - sample(letters[3:4], 10, replace=TRUE)
v3 - sample(letters[5:6], 10, replace=TRUE)
aa - data.frame(v1=v1, v2=v2, v3=v3)
And now is simple,
Thanks for the answer.
Unfortunately, I'm not yet skilled enough to do such a thing. I had a look on
the code and I'll try to understand it, as a good exercise.
I thought about sending fake fit objects to nomogram() derived from the
original one :
- orignal : f2- cph(Surv(d.time,death) ~
On Sun, May 23, 2010 at 5:09 AM, Peter Ehlers ehl...@ucalgary.ca wrote:
On 2010-05-23 0:56, john smith wrote:
Hi,
I am trying to implement Higham's algorithm for correcting a non positive
definite covariance matrix.
I found this code in R:
As Frank mentioned in his reply, expecting to estimate tens of
thousands of fixed-effects parameters in a logistic regression is
optimistic. You could start with a generalized linear mixed model
instead
library(lme4)
fm1 - glmer(resp ~ 1 + (1|f1) + (1|f2) + (1|f1:f2), mydata, binomial))
If you
On May 23, 2010, at 3:27 AM, Erik Iverson wrote:
Hello,
sedm1000 wrote:
Sorry - I figured that this to be a more common defined error than
anything
specific to the data/function... Thanks for looking at this.
The data and function are below. Creating a single line of the
data.frame at
On 05/23/2010 06:29 AM, Marc Carpentier wrote:
Thanks for the answer.
Unfortunately, I'm not yet skilled enough to do such a thing. I had a look on
the code and I'll try to understand it, as a good exercise.
I thought about sending fake fit objects to nomogram() derived from the
original one :
On May 22, 2010, at 10:48 PM, Mohan L wrote:
Dear All,
I have an array some thing like this:
avglog
January February March April May June July
August September
60102 83397 56774 48785 49010 40572 38175
47037 51402
The class of avglog
Hi,
I have a dataset that looks like the one below.
data
plot plantno.species
H 31 ABC
D 2 DEF
Y 54 GFE
E 12 ERF
Y 98 FVD
H 4 JKU
J 7
try this:
x - read.table(textConnection(plot plantno.species
+ H 31 ABC
+ D 2 DEF
+ Y 54 GFE
+ E 12 ERF
+ Y 98 FVD
+ H 4 JKU
+ J 7 JFG
Thanks, but what I want is not 100 groups of 7 samples. Let's say in
my samp2 I get
[[1]] D H K S E U O
[[2]] H S R V A L B
etc...
I want to select all rows from 'data' containing D H K S E
U O first, then H S R V A L B and so on.
On May 23, 10:12 pm, jim holtman jholt...@gmail.com wrote:
On May 23, 2010, at 10:00 AM, Kang Min wrote:
Hi,
I have a dataset that looks like the one below.
data
plot plantno.species
H 31 ABC
D 2 DEF
Y 54 GFE
E 12 ERF
Y 98 FVD
H
Hello,
Can anyone think of a non-iterative way to generate a decreasing geometric
sequence in R?
For example, for a hypothetical function dg, I would like:
dg(20)
[1] 20 10 5 2 1
where I am using integer division by 2 to get each subsequent value in the
sequence.
There is of course:
Erik Iverson wrote:
Hello,
Can anyone think of a non-iterative way to generate a decreasing geometric
sequence in R?
For example, for a hypothetical function dg, I would like:
dg(20)
[1] 20 10 5 2 1
where I am using integer division by 2 to get each subsequent value in the
sequence.
I'm using the plotCI function and I'd like to overlay additional means
with CIs onto an existing plotCI-created plot in a different color. Is
this possible? Thanks.
Rick
__
R-help@r-project.org mailing list
Erik Iverson er...@ccbr.umn.edu writes:
Hello,
Can anyone think of a non-iterative way to generate a decreasing
geometric sequence in R?
For example, for a hypothetical function dg, I would like:
dg(20)
[1] 20 10 5 2 1
where I am using integer division by 2 to get each subsequent value
Rick Reiss rreiss at exponent.com writes:
I'm using the plotCI function and I'd like to overlay additional means
with CIs onto an existing plotCI-created plot in a different color. Is
this possible? Thanks.
Rick
Assuming you mean the one from the plotrix package: use add=TRUE
Erik Iverson eriki at ccbr.umn.edu writes:
Can anyone think of a non-iterative way to generate a decreasing geometric
sequence in R?
Reduce(%/%,rep(2,4),init=20,accum=TRUE)
__
R-help@r-project.org mailing list
On May 23, 2010, at 1:43 PM, Erik Iverson wrote:
Hello,
Can anyone think of a non-iterative way to generate a decreasing
geometric sequence in R?
For example, for a hypothetical function dg, I would like:
dg(20)
[1] 20 10 5 2 1
where I am using integer division by 2 to get each
Hi everybody, this is a real dummy thing.
I sorted a matrix based on a given column, and what I get is right, until it
comes to columns of negative and positive values; than, order orders
everything from max to min in the negative values, and then AGAIN from max to
min in the positive
do 'str' on your object to see if you have factors where you think you
have numerics.
What is the problem you are trying to solve?
Sent from my iPhone.
On May 23, 2010, at 17:39, Zoppoli, Gabriele (NIH/NCI) [G] zoppo...@mail.nih.gov
wrote:
Hi everybody, this is a real dummy thing.
I
I tried this, but it doesn't change the division between negative and
positive values (see that you have first positive from max to min, and then
negative from min to max, as if order considered only the absolute values...)
Product hsa.miR.204 hsa.miR.210 Tissue
48 ME:SK_MEL_5
On 23-May-10 21:39:06, Zoppoli, Gabriele (NIH/NCI) [G] wrote:
Hi everybody, this is a real dummy thing.
I sorted a matrix based on a given column, and what I get is right,
until it comes to columns of negative and positive values; than,
order orders everything from max to min in the negative
This is what I get:
str(x)
chr [1:60, 1:4] ME:SK_MEL_5 ME:SK_MEL_28 ME:SK_MEL_2 ...
- attr(*, dimnames)=List of 2
..$ : chr [1:60] 48 47 46 50 ...
..$ : chr [1:4] Product hsa.miR.204 hsa.miR.210 Tissue
It doesn't make much sense to me...
I would like to have the second column ordered
crazy stuff!!! I tried to reload the txt file, and now it's working...
this is the original (attached)
thanks!
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of
Genova, Genova, Italy
Guest Researcher, LMP, NCI, NIH, Bethesda MD
Work:
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Zoppoli,
Gabriele (NIH/NCI) [G]
Sent: Sunday, May 23, 2010 3:44 PM
To: ted.hard...@manchester.ac.uk
Cc: R-help@r-project.org
Subject: Re: [R] order issue
crazy stuff!!! I
On May 23, 2010, at 6:32 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote:
This is what I get:
str(x)
chr [1:60, 1:4] ME:SK_MEL_5 ME:SK_MEL_28 ME:SK_MEL_2 ...
- attr(*, dimnames)=List of 2
..$ : chr [1:60] 48 47 46 50 ...
..$ : chr [1:4] Product hsa.miR.204 hsa.miR.210 Tissue
It doesn't make
Good evening gentlemen!
I have a test in split-plot with randomized block design where my answer is
a binomial variable. I wonder if there is any way I can calculate the
probability of my factors considering the design errors in the case are two.
I looked at various threads here and elsewhere,
after read.delim:
'data.frame': 60 obs. of 4 variables:
$ Cell : Factor w/ 60 levels BR:BT_549,BR:HS578T,..: 23 51 20 25 34
16 44 3 60 55 ...
$ hsa-miR-204: num -4.37 -4.34 -4.33 -4.29 -4.26 ...
$ hsa-miR-210: num -0.223 1.575 1.66 1.668 0.373 ...
$ Tissue : Factor w/ 9 levels
Hi r-users,
I have this data below. I would like to obtain the weekly rainfall sum. That
is I would like to find sum for day 1 to day 7, day 8 - day15, and so on.
year month day rain
1 1922 1 1 0.0
2 1922 1 2 0.0
3 1922 1 3 0.0
4 1922 1 4 0.0
5 1922 1
Dear list,
I'd like to use path.analysis in the package agricolae in batch format on
many files, retrieving the path coefficients for each run and appending them
to a table. I don't see any posts in the help files about this package or
the path.analysis package. I've tried creating an object out
This is one way to do it. Suppose your data is in the file rainfall.txt, as
set out below. Then
dat - read.table(rainfall.txt, header = TRUE)
dat - within(dat, {
+ date - as.Date(paste(year, month, day, sep=-))
+ week - factor(as.numeric(date - date[1]) %/% 7)
+ })
wRain - with(dat,
Hello,
I am running R on a server that several people share. Previously we
all had separate libraries for R.
I have set up R so everyone on the server shares the same library and
I downloaded the latest version of R and installed it on the
main drive of our server in the Program Files folder
Thanks for your time with this. Erik's solution works best to deal with the
input... I'll try to reshape the output back into the appropriate columns.
David, fold(sq$s1) only outputs the result for the first sequence in the
list I'm afraid. The 'fold' function doesn't deal well with spaces...
Dear Friends.
I am just starting to use R. And in this occasion I want to construct a
high-dimensional contingency table, because I want to crate a mosaic plot
with the vcd package.
My table is in this format:
año ac.repcat.gru conteos
1 2005 Rparejas 253
2 2005 N
I am attempting to import dates in the following format to R:
5/20/2010 6:45:32 PM
Unfortunately I am unable to get the AM/PM function (%p) to work correctly
under either 2.11.0 or 2.8.1.
strptime(5/20/2010 6:45:32 PM, %m/%d/%Y %I:%M:%S %p)
[1] NA
but
strptime(5/20/2010 6:45:32, %m/%d/%Y
I know it is not very useful to you, but on Vista with 2.11.patched it
works:
strptime(5/20/2010 6:45:32 PM, %m/%d/%Y %I:%M:%S %p)
[1] 2010-05-20 18:45:32
strptime(5/20/2010 6:45:32, %m/%d/%Y %I:%M:%S)
[1] 2010-05-20 06:45:32
sessionInfo()
R version 2.11.0 Patched (2010-04-26 r51822)
Thanks for the suggestions! This will keep me busy for a while.
Tom
2010/5/15 Muenchen, Robert A (Bob) muenc...@utk.edu:
Thomas Levine wrote:
Bob Muenchen says that 'Ralph O’Brien says that
in a few years there will be so many students
graduating knowing mainly R that [he]’ll need to
write,
On May 23, 2010, at 8:41 PM, Claudia Rodriguez wrote:
Dear Friends.
I am just starting to use R. And in this occasion I want to
construct a
high-dimensional contingency table, because I want to crate a mosaic
plot
with the vcd package.
My table is in this format:
año ac.repcat.gru
HI, Dear R community,
I want to know how to select the optimal decision threshold from the ROC
curve? At what threshold will give the highest accuracy?
Thanks!
--
Sincerely,
Changbin
--
[[alternative HTML version deleted]]
__
If the days are consecutive with no missing rows then the dates don't
need to be calculated and it could be represented as a ts series with
a frequency of 7. Just aggregate it down to a frequency of 1:
rain - ts(dat$rain, freq = 7)
aggregate(rain, 1)
If there are missing rows (or even
57 matches
Mail list logo