data(mtcars)
mtcars[rownames(mtcars)!=Valiant,] # fails
mtcars[list(rownames(mtcars))!=Valiant,] # runs but I am not getting the
expected result
With the latter statement, I expected all rows except the one where the name is
Valiant.
I must have got something simple wrong; what is it?
To be fair, RODBC is just an interface to ODBC, and this is not an ODBC support
forum. In my experience, ODBC works alright when used to connect to a SQL
database, but is pretty flaky when used to connect to Excel or CSV files.
Undoubtedly. However, it probably won't affect the time it takes to finish by
very much.
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.
Hi MJ,
Thanks alot for this. I will try and revert.
Â
Taby
An idea not coupled with action will never get any bigger than the brain cell
it occupied.
Arnold Glasgow
..
Attempt something large enough that failure is guaranteedâ¦unless God steps
in!
Hi Ajay,
In the first case, you need == instead of = :
R mtcars[ rownames(mtcars) == Valiant, ]
mpg cyl disp hp drat wt qsec vs am gear carb
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 031
For the second case,
R mtcars[rownames(mtcars) != Valiant,]
will do it.
See also
Hello,
I am having two data set original and predicted.
I want to dind QQ-plot fot it.
I tried in following manner :
qq(original~predicted)
and error was :
Error in qq.formula(o ~ p) : y must have exactly 2 levels
There is an option qtype which dosent make any difference.
What is the correct
it's that easy, eh?
thank you for your input, it's much appreciated.
i will have a look at nlmer as well.
markus
On Thu, Feb 16, 2012 at 23:17, David Winsemius [via R]
ml-node+s789695n4395634...@n4.nabble.com wrote:
On Feb 16, 2012, at 11:43 AM, protoplast wrote:
hello mailing list!
On 17/02/12 21:32, nandan amar wrote:
Hello,
I am having two data set original and predicted.
I want to dind QQ-plot fot it.
I tried in following manner :
qq(original~predicted)
and error was :
Error in qq.formula(o ~ p) : y must have exactly 2 levels
There is an option qtype which dosent
hi,
I have a question regarding cp values in rpart(). When I use plotcp() I get
a figure with cp values on the x-axsis, but then I use printcp() the cp
values in that list are different from the values in the figure by
plotcp(). Does someone know why?
Silje
[[alternative HTML version
Hi Michael and Rui,
thanks a lot for the tips.
It worked with both your suggestions!
I also found out, that this problem only exists if I put header=T.
Thanks again!
Marion
If you don't need to refer to colnames you should be fine.
If you do need to subset by colnames, you can still do it
HELLO ALL,
I AM GETTING AN ERROR MESSAGE WHEN TRYING TO RUN A GAMM MODEL LIKE THE ONE
BELOW.
I AM USING R VERSION 2.14.1 (2011-12-22) AND MGCV 1.7-12.
M1 -gamm(DepVar ~ Treatment + s(Year, by =Treatment), random=list(Block=~1),
na.action=na.omit, data = mydata, correlation =
Thanks a lot Turner.
Latter I also tried following :
oo-quantile(original, probs = seq(0, 1, 0.01), type = 8)
pp-quantile(predicted, probs = seq(0, 1, 0.01), type = 8)
plot(oo,pp)
But plot for above and following (as you suggested) are not same.
What may be the error ?
Thanks.
On Fri, Feb 17,
Thank you Michael
--
View this message in context:
http://r.789695.n4.nabble.com/Plotting-monthly-maps-from-yearly-data-tp4391704p4396787.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
I have two different datasets
1) is in monthly format (obs)
2) yearly format (model)
in obs I have 84 files ( 2003:2009)for different months in model I have 4
different files which has yearly data (2005:2008)
So for calculating my requirement I need these both data sets.
The sample
eva,
I can't manage to replicate this by simulation. Is there any chance you
could send me the data off-list, and I can take a look (if so I'll only
use the data for the purpose of finding out what's wrong, of course).
best,
Simon
On 17/02/12 09:35, HERNANDEZ PLAZA, MARIA EVA wrote:
Dear ALL
I have this function in R:
func_LN - function(data){
med_ge - matrix(c(rep(NA,nrow(data)*ncol(data))), nrow = nrow(data),
ncol=ncol(data), byrow=TRUE)
T - matrix(c(rep(NA,length(n)*ncol(data))), nrow = length(n),
ncol=ncol(data), byrow=TRUE)
Tdiff-
Hi all,
I'm developing an R package and I'd like to load it easly while developing,
debugging and testing. I would like to load it without having to install
it. Installing it causes me some problems for debugging it, as the code
file it is executing it not the one I'm editing.
I've seen the
On Fri, Feb 17, 2012 at 12:44:44PM +0100, Soheila Khodakarim wrote:
Dear ALL
I have this function in R:
func_LN - function(data){
med_ge - matrix(c(rep(NA,nrow(data)*ncol(data))), nrow = nrow(data),
ncol=ncol(data), byrow=TRUE)
T - matrix(c(rep(NA,length(n)*ncol(data))), nrow =
Alex,
You may find an answer to your question by searching the R-SIG-Finance
archives (via rseek.org). If not, you may want to consider asking
your question on the R-SIG-Finance list.
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrading.com
R/Finance 2012: Applied Finance with R
Hi
apply probably does not understand you function. I do not want to go too
deeply into it but I noticed few issues in it. See inline
Dear ALL
I have this function in R:
func_LN - function(data){
med_ge - matrix(c(rep(NA,nrow(data)*ncol(data))), nrow = nrow(data),
peter dalgaard pdalgd at gmail.com writes:
On Feb 16, 2012, at 12:31 , Hans W Borchers wrote:
I have often seen the use of routines from the ACM Collected Algorithms,
i.e. netlib.org/toms/≥ (CALGO, or Trans. On Math. Software, TOMS), in
Open Source programs, maybe also in some R packages
On Feb 17, 2012, at 13:42 , Hans W Borchers wrote:
peter dalgaard pdalgd at gmail.com writes:
On Feb 16, 2012, at 12:31 , Hans W Borchers wrote:
I have often seen the use of routines from the ACM Collected Algorithms,
i.e. netlib.org/toms/≥ (CALGO, or Trans. On Math. Software, TOMS), in
Dear all,
I have a data frame in which the columns need to be ordered. The first column X
is at the right position, but the remaining columns X1-Xn should be ordered
like this: X1, X2, X3 etc instead of like below.
colnames(pos1)
[1] X X1 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19
X2 X20
mredfar marhat at gmail.com writes:
Hello, I'm struggling with understanding the output on the ancestral.pars()
command from the phangorn package, I'm new to doing phylogenetic analyses
using R.
I used it on nucleotide data, and it works fine, I'm just not sure how to
read the output.
Sean Godwin sean.godwin at gmail.com writes:
Hi all,
I am fairly new to mixed effects models and lmer, so bear with me.
Here is a subset of my data, which includes a binary variable (lake (TOM or
JAN)), one other fixed factor (Age) and a random factor (Year).
lake FishID Age
fakedata - data.frame(A=c(0,0,0), X2=c(2,2,2), X1=c(1,1,1), X3=c(3,3,3))
fakedata
A X2 X1 X3
1 0 2 1 3
2 0 2 1 3
3 0 2 1 3
pos - colnames(fakedata)[2:ncol(fakedata)]
pos - c(1, 1+as.numeric(gsub(X, , pos)))
fakedata[, pos]
A X1 X2 X3
1 0 1 2 3
2 0 1 2 3
3 0 1 2 3
pos2 - pos1[, c(X, X1, X2, X3, X4, X5, X6, X7, X8,
X9, X10, X11, X12,
X13, X14, X15, X16, X17, X18, X19, X20)]
2012/2/17 Joel Fürstenberg-Hägg jo...@life.ku.dk:
Dear all,
I have a data frame in which the columns need to be ordered. The first column
X is at the right position, but the
On Feb 16, 2012, at 8:32 PM, jpm miao wrote:
Hello,
I have a question on how to tabulate the time series data. I use
RStudio, but if can be done in any other R editor, it should work in
RStudio as well.
Most people have given up on using R's time series class and have
moved over to
On Fri, Feb 17, 2012 at 02:26:52PM +0100, Joel Fürstenberg-Hägg wrote:
Dear all,
I have a data frame in which the columns need to be ordered. The first column
X is at the right position, but the remaining columns X1-Xn should be ordered
like this: X1, X2, X3 etc instead of like below.
It does not work when using more variables, and my data frames usually
contains about thousand columns...
Best,
Joel
fakedata - data.frame(A=c(0,0,0), X1=c(1,1,1), X6=c(6,6,6),
X7=c(7,7,7), X3=c(3,3,3), X4=c(4,4,4), X9=c(9,9,9), X2=c(2,2,2),
X8=c(8,8,8), X5=c(5,5,5))
fakedata
A X1 X6 X7
@Alfredo
The X is removed, but the reordering does not work:
colnames(df)[1] - Mass
columnNames - colnames(df)
colnames(df)
[1] Mass X1 X10 X11 X12 X13 X14 X15 X16
X17 X18 X19 X2 X20 X3 X4 X5 X6 X7
X8 X9
colnames(df) - gsub(X,,colnames(df))
colnames(df)
@ Jim
That would work for just a few columns, but I will have around 1000 of
them so I need something more generic.
best,
Joel
jim holtman jholt...@gmail.com 17-02-2012 14:44
pos2 - pos1[, c(X, X1, X2, X3, X4, X5, X6, X7, X8,
X9, X10, X11, X12,
X13, X14, X15, X16, X17, X18, X19,
Sorry, it should be:
fakedata[, order(pos)]
A X1 X2 X3 X4 X5 X6 X7 X8 X9
1 0 1 2 3 4 5 6 7 8 9
2 0 1 2 3 4 5 6 7 8 9
3 0 1 2 3 4 5 6 7 8 9
Using order also ensures that non-sequential column ids will work:
fakedata - data.frame(A=c(0,0,0), X1=c(1,1,1), X6=c(6,6,6),
Thank you Sarah, now it works!!
Sarah Goslee sarah.gos...@gmail.com 17-02-2012 15:13
Sorry, it should be:
fakedata[, order(pos)]
A X1 X2 X3 X4 X5 X6 X7 X8 X9
1 0 1 2 3 4 5 6 7 8 9
2 0 1 2 3 4 5 6 7 8 9
3 0 1 2 3 4 5 6 7 8 9
Using order also ensures that
stepAIC works for an object of clogit.
Weidong Gu
On Fri, Feb 17, 2012 at 2:10 AM, Subha P. T. subha_...@yahoo.com wrote:
Hi,
Is there any function available to do stepwise selection of variables in
Conditional(matched) logistic regression( clogit)? step, stepwise etc are
failing in
eva,
The problem is that the random effects and correlation structure that
you have specified don't meet the restrictions required by lme (which
gamm calls). You can see this by trying
M0 -lme(H ~ Tillage , random=list(Block=~1), na.action=na.omit, data =
mydata, correlation = corARMA(form
Hi Ajay,
Like Jorge, I can't seem to reproduce the behavior you are worried about.
mtcars[rownames(mtcars) != Valiant,]
returns a 31x11 data.frame as expected.
When you say it fails, what error message / result are you seeing?
Michael
On Fri, Feb 17, 2012 at 3:27 AM, Jorge I Velez
On 17/02/2012 7:01 AM, David Cassany wrote:
Hi all,
I'm developing an R package and I'd like to load it easly while developing,
debugging and testing. I would like to load it without having to install
it. Installing it causes me some problems for debugging it, as the code
file it is executing
I've got a small problem.
I have some observational data (environmental samples: abiotic explanatory
variable and biological response) to which I've fitted both a multiple linear
regression model and also a gam (mgcv) using smooths for each term. The gam
clearly fits far better than the lm
Thank you for trying to improve your question, but it's still
impossible to help: the problem is almost certainly in this block of
code:
plotting##
year - 2005:2008
month- (jan,Feb,March,..Dec)
for ( y in year)
for (m in month)
here I use Sp plot and plot
On Feb 17, 2012, at 2:10 AM, Subha P. T. wrote:
Hi,
Is there any function available to do stepwise selection of
variables in Conditional(matched) logistic regression( clogit)?
step, stepwise etc are failing in case of conditional logistic
regression.
Failing is open to a variety
Mike,
Isn't this just an example of the wrong model giving a spurious
impression of precision? or more accurately, precision at the expense of
accuracy?
Here's a linear model example of the same thing...
set.seed(1)
n - 400
x - runif(n)-.5
y - 2+ x*.2+ x^2 + rnorm(n)*.5
m1 - lm(y~1)
m2 -
Also, when you're doing reading through David's suggestions:
On Fri, Feb 17, 2012 at 10:41 AM, David Winsemius
dwinsem...@comcast.net wrote:
[snip]
Stepwise procedures are supported somewhat grudgingly on r-help. You ought
to read some of the critical comments about stepwise procedures in the
I think my problem is that I can't
incorporate the 'lake' variable in a fixed-effect interaction because it is
only has one binary observation. But I don't know what to do to be able to
fit this model. Any help would be greatly appreciated!
-Sean
In principle you should be able to fit
Srs.
QR codes (barcode) can be generated with R-cran?, there is a package that
allows it.
Watch for your answers.
Agustín M.
Carpe Diem!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hi everybody!I'm a new user of R. I've been having a look to sotored mails in
list, but I've been not able to find one suiting to my need. The issue is I
have a neighbour list in a TXT file, just as lists generated by social network
softwares (f.i. Pajek), where you get Field1, Field2, Value.
Hey guys, I'd really appreciate any help.
I have a multivariate analysis done, the output of which is:
GraphData -read.table(eigen.coa)
GraphData
V1 V2 V3 V4
1 1 0.371970 0.8552 0.8552
2 2 0.061785 0.1420 0.9972
3 3 0.001211 0.0028 1.
4 4 0.00 0. 1.
Hi Joel,
to replace the colnames:
colnames(dataframe - )gsub(X,,colnames(dataframe))
to order by colnames:
dataframe - dataframe[,colnames(dataframe)]
Alfredo
2012/2/17 Joel Fürstenberg-Hägg jo...@life.ku.dk
Dear all,
I have a data frame in which the columns need to be ordered. The
Hi,
I'm running into the same issue. I run is.factor() on training data and
validation data. All returned false.
--
View this message in context:
http://r.789695.n4.nabble.com/Where-command-in-ctree-party-tp3264187p4397640.html
Sent from the R help mailing list archive at Nabble.com.
Regards.
I'm a beginner in programing, so I have a basic question for you.
If someone could help me please..
I want to create a function, which will be able to export files from excel.
I tried with
a - read.csv(file, sep =,, as.is = TRUE, row.names = 1, header = TRUE),
.. but instead of
i run class(). Both have the same class.
--
View this message in context:
http://r.789695.n4.nabble.com/Where-command-in-ctree-party-tp3264187p4397693.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
There are lots of multivariate graphs.perhaps browsing this
gallery will give you some idea of what you want (example code is
provided): http://addictedtor.free.fr/graphiques/
This blog also does a nice job of introducing some graphs with the
ggplot2 package: https://learnr.wordpress.com/
Thank you Simon,
that works well.
I had tried previously
m1 -gamm(H ~ Tillage + s(Year, by =Tillage), random=list(Block=~ Tillage),
na.action=na.omit, data =mydata, correlation = corARMA(form =~
Year|Tillage/Block, p = 1, q = 0))
and that gave me convergence problems.
Thank you!
Hello
I have several populations where I have morphology and diet for each
individual. I am interested in the correlation between diet and
morphological distances. However the number of individuals in each
population ranges from 22 to 80 individuals. I have looked at the
correlation
If you know all your data should be numeric, you could perhaps try
something like this:
apply(a, 2, function(x) as.numeric(gsub( , , x)))
but it can't be tested without your actual data. (Look at dput() for
the best way to send data by email)
Michael
On Fri, Feb 17, 2012 at 12:24 PM, gaja
On 17.02.2012 11:18, silje skår wrote:
hi,
I have a question regarding cp values in rpart(). When I use plotcp() I get
a figure with cp values on the x-axsis, but then I use printcp() the cp
values in that list are different from the values in the figure by
plotcp(). Does someone know why?
At least post the first 10 lines of the file so that we can see what
it is. It may be that some of the data is enclosed in quotes, but it
is hard to tell without seeing the actual data.
On Fri, Feb 17, 2012 at 12:24 PM, gaja gajahor...@hotmail.com wrote:
Regards.
I'm a beginner in programing,
You might want to post a better example of what your data looks like.
In the email, it is hard to tell how to split the data into rows that
can be read with three fields since it looks like the data is composed
of pairs of numbers.
On Fri, Feb 17, 2012 at 7:42 AM, A J anxu...@hotmail.com wrote:
Sorry too much. I was convinced it was able to view well. So, the structure of
my data set is something like this:
ID1 IDP2 SUMVAL
1 56 0.0659358951 900 0.0441101851 1409 0.1963141973 4
0.0713203883 83 0.0162695643 529 0.0113592393 883 0.0122425333
1242
Is this what you are after:
x - read.table(text = ID1 IDP2 SUMVAL
+ 1 56 0.065935895
+ 1 900 0.044110185
+ 1 1409 0.196314197
+ 3 4 0.071320388
+ 3 83 0.016269564
+ 3 529 0.011359239
+ 3 883 0.012242533
+ 3 1242 0.016558924
+ 4 3 0.004307024
+ 4 7
On Fri, 17 Feb 2012, josephw wrote:
i run class(). Both have the same class.
Without a reproducible example it is hard to say what is going on here.
All columns of the learning and the test data need to have (a) the same
name, (b) the same class, (c) the same levels in case they are
NYC-based equity asset management company is seeking a junior-level
programmer with R, VBA, and MS-SQL skills. HTML skill is a plus. This
permanent, full-time position will involve working on projects and
improving our daily processes. Finance knowledge is helpful, but not
necessary. We are an
Thanx for posting. :)
I'm posting a link to excel file, same as I want import to table.
Its dl link, don't be mad, hehe
http://spreadsheets.google.com/pub?key=phAwcNAVuyj0XOoBL_n5tAQoutput=csv
Thanx,G.
ps: @Michael Weylandt;
Thanx for your code,... I tried to used it, but unsucsesfully. I
I was able to narrow down to a column that has different types using
featurefields-c(7, 17, 19, 20, 22, 33, 35, 36, 38, 44:132)
flag - rep(0, ncol(data))
for (i in featurefields) {
flag[i] - class(data[,i]) != class(validdata[,i])
}
It is an integer class in the training data but is
I don't know why data are not well shown... I have attached a PDF file to this
message with the structure of the begining list and the final matrix one. I
think I have no explain the issue in a right way. Sorry for the inconveniences.
The last thing I want is to disturb with technical
can any one please tell me how can I Compute the covariance matrix of (Y)
which is 5 variables .. without using a built-in function??
2) how (cov) works ( I need to get the details for this function ???
--
View this message in context:
Yes, the function is based on the idea that you have two random variables, X
and Y and the covariance is then computed as
Cov(x,y) = E[(X - E(X)) (Y - E(Y))]
Where E[.] is the expectation operator.
-Original Message-
From: r-help-boun...@r-project.org
On Feb 17, 2012, at 2:19 PM, A J wrote:
I don't know why data are not well shown... I have attached a PDF
file to this message with the structure of the begining list and the
final matrix one.
You should have attached the sample.txt file.
I think I have no explain the issue in a right
This sounds remarkably like homework. You can address your own issue using
the built-in help system and R's capability to allow you to view source code
for functions, but we can't help you do your assignments.
Sarah
On Fri, Feb 17, 2012 at 2:36 PM, Ali2006 nasser-d2...@hotmail.com wrote:
can
Another newbie question
I got the 1 minute spine interpolation and 15 mean aggregation working with
many thanks to Gabor Grothendieck using Zoo functions. I got a tip from
Hasan Diwan to look at xts but it seemed I would make better progress using
code from Gabor.
Now I'm having trouble plotting
On Feb 17, 2012, at 2:36 PM, Ali2006 wrote:
can any one please tell me how can I Compute the covariance matrix
of (Y)
which is 5 variables .. without using a built-in function??
2) how (cov) works ( I need to get the details for this function ???
?write.zoo
Perhaps with sep = , if you have multiple columns.
Michael
On Fri, Feb 17, 2012 at 2:56 PM, Henry hcco...@lbl.gov wrote:
Another newbie question
I got the 1 minute spine interpolation and 15 mean aggregation working with
many thanks to Gabor Grothendieck using Zoo functions. I
Given
dayOfWeekName-c(Mon,Tue,Wed,Thu,Fri,Sat,Sun);
dayOfWeekOrdinal-c(1,2,3,4,5,6,0);
dayOfWeekWorkDay-c(TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE);
weekProfile-list(dow=dayOfWeekName,dowI=dayOfWeekOrdinal,dowW=dayOfWeekWorkDay)
1. How can I conditionally get dow, dowI, and dowW from weekProfile?
HI Ajay,
On Fri, Feb 17, 2012 at 3:20 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote:
Given
dayOfWeekName-c(Mon,Tue,Wed,Thu,Fri,Sat,Sun);
dayOfWeekOrdinal-c(1,2,3,4,5,6,0);
dayOfWeekWorkDay-c(TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE);
Thank you Jorge Michael.
I was being stupid - its the only explanation!
The line I had been executing was
mtcars[rownames==Valiant] # missing rownames argument
but the line I quoted in my post was
mtcars[rownames(mtcars) != Valiant,] # How could I write the correct line in
the mailing
Hi Sarah,
Thanks you for the clarifications; I had worked round the problem
by switching to a data.frame.
However, I am still unclear about 'list': as it exists, it must
have a purpose. When is the use of the list data structure appropriate?
[[alternative HTML
On Fri, Feb 17, 2012 at 3:37 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote:
Hi Sarah,
Thanks you for the clarifications; I had worked round the
problem by switching to a data.frame.
However, I am still unclear about 'list': as it exists, it must
have a purpose. When is
Thank, thats what I need, using the built-in help system and R's capability to
allow you to view source code for functions, but how???
Date: Fri, 17 Feb 2012 14:55:10 -0500
Subject: Re: [R] covariance
From: sarah.gos...@gmail.com
To: nasser-d2...@hotmail.com
CC: r-help@r-project.org
could you help with example ??
--
View this message in context:
http://r.789695.n4.nabble.com/covariance-tp4398242p4398470.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On Fri, Feb 17, 2012 at 11:06:23PM +0300, Naser Albalwi wrote:
Thank, thats what I need, using the built-in help system and R's capability
to allow you to view source code for functions, but how???
Hi.
First, type cov without quotation marks to R's prompt. The
printed code calls
On 18/02/12 00:15, nandan amar wrote:
Thanks a lot Turner.
Latter I also tried following :
oo-quantile(original, probs = seq(0, 1, 0.01), type = 8)
pp-quantile(predicted, probs = seq(0, 1, 0.01), type = 8)
plot(oo,pp)
But plot for above and following (as you suggested) are not same.
What may
This was my experience connecting remotely to an Oracle database with R 64
bit on Windows 7 64-bit. I already had a configuration for 32-bit R and
32-bit Oracle using RODBC that worked, but I wanted to only use R-64. Here
was what I did that works:
This was assuming an install to the root c:\ and
I'm now trying to read.zoo in a rather long txt file with two columns:
date/time and value in kW e.g. 432.2189
The read.zoo function finally ran without errors but not sure it is correct.
I took the header off, and put in commas and added a at the beginning and
at the end.
Thanks a lot
--
View this message in context:
http://r.789695.n4.nabble.com/Asking-About-packages-rimage-tp4395719p4398726.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
I think is good to know that list contain more than 60 rows with
around 14000 nodes (participants).
?read.table may be unreliable for large matrices and with 14/600
you'll end up with many NA's. You might do better with
nbrs- scan('nbrs.txt',skip=1,what=list('integer','integer',double(0)))
Is this what you want to do: this will remove the commas and convert to numeric
x - read.csv(C:\\jph\\indicatorgapminderpopulation.csv
+ , as.is = TRUE
+ , check.names = FALSE
+ )
# convert to numeric column 2+
for (i in 2:ncol(x)){
+ x[, i] -
FWIW:
Lists are a fundamental, universal, recursive data structure. All
other data structures (i.e. r.e. sets) can be represented as lists.
Indeed, one of the earliest high level (non-machine instructions)
computer languages, McCarthy's LISP = List Processing, is based on
lists. R was designed to
Try this:
setClass(myClass)
setAs(character, myClass, function(from)as.numeric(gsub(,, , from)))
d - read.table(clipboard, sep = ,, check.names = FALSE, quote = '',
header = TRUE, fill = TRUE, colClasses = c('character', rep('myClass',
232)))
On Fri, Feb 17, 2012 at 3:24 PM, gaja
The problem now is it looks like my read.zoo isn't working.
Sorry for sort of double posting.
Someone please assist if you have time with my read.zoo command line.
my data is as just below this line, a time stamp and a real number with a
comma sep.
10/11/2011 23:00:06,432.12
Henry,
You're reading a CSV with read.zoo. This is not likely to work. The
way I'd do this is:
data - read.csv('/tmp/Kevin-0-comma-ITPower.txt', header=FALSE)
z - zoo(data[,2], order.by=as.POSIXct(data[,1], format='%d/%m/%y
%H:%M:%S') # or whatever your format actually is...
-- H
Sent from my
Hi everyone,
For reasons beyond the scope of this message, I'd like to append a
NULL element to the end of a list.
tmp0 - list(a=1, b=NULL, c=3)
append(tmp0, c(d=4)) ## works as expected
append(tmp0, c(d=NULL)) ## list with a/b/c only
Given that I could use
tmp0$a - NULL
to remove 'a', I seem
On Feb 17, 2012, at 8:51 PM, Benilton Carvalho wrote:
tmp0 - list(a=1, b=NULL, c=3)
length(tmp0) - 4
tmp0
$a
[1] 1
$b
NULL
$c
[1] 3
[[4]]
NULL
David Winsemius, MD
West Hartford, CT
__
R-help@r-project.org mailing list
Thank you very much, David.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Hi Benilton: David's solution is short and sweet but below also works. I
searched and searched and finally found it in the R-inferno by Patrick
Burns. I never looked at the R-inferno carefully before. After glancing at
it, I'm printing it out and binding it tomorrow. It's the
got ya book for R.
It looks like you've gotten answers elsewhere, but for completeness, I'll
explain my shot in the dark:
The construction
function (x) sin(x^2)
to pick one example, is what's called an anonymous (or lambda) function. In R,
they are often used in conjunction with the *apply() family to
Hi Sean,
Thanks for the data. Your first problem is that Age is a factor with
14 levels. Second, Year is a factor with 16 levels. Now consider
what interactions of these will be---factors with a huge number of
levels, exceeding what is reasonable to fit to your size of data. I
included inline
Thanks Gabor/Duncan,
I might give that proto package a try. The R.oo package is more intuitive
for someone coming from a traditional OO background, but compared to proto,
it looks like it requires a lot more typing to create the same amount of
functionality. I've used R.oo for a number of months
Hi all,
Is there any command or function to withdraw
a command performed already in R? For instance, after drawing a line in
existing plot, can I remove the line in the plot? I know I can use a way of
overlapping on the former line so that it looks like a removing the line,
but I'm wondering
On Fri, Feb 17, 2012 at 7:54 PM, Henry hcco...@lbl.gov wrote:
The problem now is it looks like my read.zoo isn't working.
Sorry for sort of double posting.
Someone please assist if you have time with my read.zoo command line.
my data is as just below this line, a time stamp and a real number
On Fri, Feb 17, 2012 at 2:56 PM, Henry hcco...@lbl.gov wrote:
Another newbie question
I got the 1 minute spine interpolation and 15 mean aggregation working with
many thanks to Gabor Grothendieck using Zoo functions. I got a tip from
Hasan Diwan to look at xts but it seemed I would make
1 - 100 of 103 matches
Mail list logo