1. Read an Introduction to R (ships with R) or other R tutorial (there
are many good ones on the Web).
1.5 ... Also check CRAN for books and other info.
2. ?write.table
but you'll need what you learn in the tutorial to extract output
from your functions.
2.5 ...and of course, ?xtabs and
Hello,
The following works fine for me:
nc - nc_open(~/GEIA_N2O_oceanic.nc)
emi_n2o - ncvar_get(nc, 'emi_n2o', start=c(1,1,1), count=c(-1,-1,1))
Regards,
Pascal
Le 28/08/2012 12:31, Tom Roche a écrit :
summary: I can successfully ncvar_put(...) data to a file, but when I
try to
Hi,
Here i have a variable named MyVariable containing particular name
For eg:-
MyVariable - UnitNo
Here my requirement is, i need to get UnitNo as another variable by
reading MyVariable
i need UnitNo as variable name and need to assign some value into that.
i had tried with
Hi Michael:
Thanks for your patience in dealing with my questions. Now, I have a
slightly better sense of R environment... data frame versus object
versus names versus tail and head etc.. etc...
I have been an avid user of Gauss (and Stata). And, I have recently
begun to use R for my
Hello,
I am testing odfWeave on a Windows XP system, but I got the following error
:
where test_in.odt comes from an Unix system. I did not get this error with a
test file created under Windows.
I suppose this has to do with the character set used in the file. What I
could I do to overcome
On Mon, Aug 27, 2012 at 8:40 PM, Roy Mendelssohn roy.mendelss...@noaa.gov
wrote:
Just looked at your code, and you do call nc_sync. I am wondering if it
works if you call nc_close, reopen and then write. Perhaps the nc_sync is
sufficent when you have been in define mode in the nc_create call.
use str(dentistry.lca2) to see all values of the output; among them a value
np for number of parameters, in this case 5*2 for the 5 binary items of 2
classes + 1 for the class proportions, total 11.
hth, Ingmar
On Mon, Aug 27, 2012 at 6:05 PM, Gabriele Accetta
gabriele.acce...@gmail.com wrote:
Hi,
I have 6 columns in my dataframe (test)
A B C D E F
a b c d 40 30
a f a b 20 10
x m y m 50 30
If character value in column A matches with that in column C, it gets the
percentage in column E, similarly if value in column B matches the value in D,
it gets the percentage in F column. If
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Sapana Lohani
Sent: Tuesday, August 28, 2012 7:01 AM
To: R help
Subject: [R] check and verify
Hi,
I have 6 columns in my dataframe (test)
A B C D E F
a b c d 40
?ifelse
Probably most simply used via ?with, e.g.l
result1 - with(test, ifelse(A == C,E,0)) ## Similarly for B and D
-- Bert
On Mon, Aug 27, 2012 at 10:00 PM, Sapana Lohani lohani.sap...@ymail.com wrote:
Hi,
I have 6 columns in my dataframe (test)
A B C D E F
a b c d 40 30
a f a b 20 10
Post a small reproducible example to clarify what you want to do.
-- Bert
On Mon, Aug 27, 2012 at 11:48 PM, Rantony antony.akk...@ge.com wrote:
Hi,
Here i have a variable named MyVariable containing particular name
For eg:-
MyVariable - UnitNo
Here my requirement is, i need to get UnitNo
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of iwaite
Sent: Tuesday, August 28, 2012 12:49 AM
To: r-help@r-project.org
Subject: Re: [R] Lattice graphics adding abline line (1:1 line) ???
I have read multiple books and
Hello,
are there fixed threshold values for the changes between different
shades of blue in the corrgram?
Or is a chang relative depending on the data?
I didnt get it in manual.
Thank you very much, best regards
Claudia
__
R-help@r-project.org
Hi
sufix-expand.grid(c(id,ag), 1:10)
paste(paste(alter,sufix[,1], sep=), sufix[,2], sep=_)
shall give you desired names.
After that you can reorganise it to suit your needs.
Regards
Petr
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org]
On 08/27/2012 07:05 PM, Rmillan wrote:
Hi all R-users,
I’m trying to assign colors on those p-value in my table output that fall
above a certain critical value, let’s say a p-value0.05.
My table looks like this:
...
Here is the data frame I used:
returns
Assets ADF_Level P0
Hello,
Try the following, supposing that 1:5 is the value you want to assign.
?assign
MyVariable - UnitNo
assign(MyVariable, 1:5)
UnitNo
Hope this helps,
Rui Barradas
Em 28-08-2012 07:48, Rantony escreveu:
Hi,
Here i have a variable named MyVariable containing particular name
For eg:-
Hi im new in the mailing list, i am trying to apply a loglinear model at my
data in order to seek for significant correlations and effects. i have 27
variables kai 146 observations. I want to make a contingency table for this
data set in R and i write
table(data) but it doesn't work and
Make a plot in R where you compare the probability distributions for the
Binomial distributions with N=1000 trials and succes probability 0.005 and
the Possion Distribution with rate lambda=5.
My answer is
b-binom(x, 1000, 0.005, log = FALSE)
plot(b)
p-dpois(x, lambda, log = FALSE)
plot(p)
Ok.
Here I have a variable called Variable_1.
Variable_1 - MyDataFrame
Here I want to create another variable, by assigning the value of Variable_1
.
So, it will come like,
Assign(Variable_1,data.frame(read.csv(c:\\Mydata.csv))) ---[this was the
1st requirement, now I got the solution]
Ok.
Here I have a variable called Variable_1.
Variable_1 - MyDataFrame
Here I want to create another variable, by assigning the value of
Variable_1 .
So, it will come like,
Assign(Variable_1,data.frame(read.csv(c:\\Mydata.csv))) ---[this
was the 1st requirement, now I got the solution]
Now,
This?
x-y
assign(x,1)
y
[1] 1
On 28.08.2012, at 10:16, Bert Gunter wrote:
Post a small reproducible example to clarify what you want to do.
-- Bert
On Mon, Aug 27, 2012 at 11:48 PM, Rantony antony.akk...@ge.com wrote:
Hi,
Here i have a variable named MyVariable containing
On 08/27/2012 07:29 PM, Rantony wrote:
Hi,
here im unable to run a string handle function called unpaste().
for eg:- a- 12345_mydata
Actually my requirement what is i need to get , only 12345. Means that , i
need the all letter as a word which is before of first _ - symbol of
a. i tried
Here I have a variable called Variable_1.
Variable_1 - MyDataFrame
Here I want to create another variable, by assigning the value of
Variable_1 .
So, it will come like,
Assign(Variable_1,data.frame(read.csv(c:\\Mydata.csv))) ---[this
was the 1st requirement, now I got the solution]
On Aug 28, 2012, at 10:43 , quantum wrote:
Make a plot in R where you compare the probability distributions for the
Binomial distributions with N=1000 trials and succes probability 0.005 and
the Possion Distribution with rate lambda=5.
My answer is
b-binom(x, 1000, 0.005, log = FALSE)
Tom Roche Mon, 27 Aug 2012 23:31:23 -0400
summary: I can successfully ncvar_put(...) data to a file, but when
I try to ncvar_get(...) the same data
in the one and only datavar
I get
Error in if (nc$var[[li]]$hasAddOffset) addOffset = nc$var[[li]]$addOffset
else addOffset = 0 :
thanks for the reply
I am sorry but I do not have any skills in C++
Nevertheless, I found a solution to my problem... By using another package
misc3d and more precisely the association of the two
functions drawScene.rgl and surfaceTriangles
On Aug 28, 2012, at 4:10 AM, Panagiwta Zygoura wrote:
Hi im new in the mailing list, i am trying to apply a loglinear
model at my data in order to seek for significant correlations and
effects. i have 27 variables kai 146 observations. I want to make a
contingency table for this data
On Aug 27, 2012, at 6:11 PM, Madana_Babu madana_b...@infosys.com wrote:
Hi All,
I am trying to install RODBC Package in Linux version of R. PFB the error
message. Request all, if you have any solution how to overcome this error.
configure: error: ODBC headers sql.h and sqlext.h not found
Hi Jim,
Oh wow thanks so much. One question though, did you notice that the
12:00:00 slot is missing entirely from the output? It shows 11:52:30 and
12:07:30, but not 12:00:00. Actually after another review I see that it's
missing the 12, 12:15, and 12:30?
2012-07-22 11:52:30 2012-07-22 12:07:30
On 28/08/2012 7:49 AM, Stephane Chantepie wrote:
thanks for the reply
I am sorry but I do not have any skills in C++
Nevertheless, I found a solution to my problem... By using another package
misc3d and more precisely the association of the two
functions drawScene.rgl and surfaceTriangles
But here, I need to split the csv file by giving file-size(in KB) as
input.
It required to split as per size(in KB), instead of giving no. of files.
Suppose, even if the file size ends in the middle of the last line, it
should include the complete last line.
For eg:
NAME AGE PLACE
A
Hi,
Any idea to - Unzip files from a given path and sub-folders to the
destination path ?
- Thanks
Antony.
--
View this message in context:
http://r.789695.n4.nabble.com/Unzip-files-from-the-given-path-to-the-destination-path-tp4641549.html
Sent from the R help mailing list archive at
You probably want to use get(), which is the converse of assign():
rbind(get(Variable_1), data.frame(read.csv(c:\\My2ndData.csv)))
On Tue, Aug 28, 2012 at 11:16 AM, Akkara, Antony (GE Energy, Non-GE)
antony.akk...@ge.com wrote:
Ok.
Here I have a variable called Variable_1.
Variable_1 -
Dear Ingmar, thank you for your email.
This means that a non-random latent class model for a 2x2x2 table (3
diagnostic tests) and 2 latent classes produces a saturated model. The
predicted frequencies equal the observed frequencies.
Is there any reason to introduce random effects in a saturated
I'm not quite sure what you expect as a result there..
On 28.08.2012, at 12:34, Akkara, Antony (GE Energy, Non-GE) wrote:
Ok.
Here I have a variable called Variable_1.
Variable_1 - MyDataFrame
Here I want to create another variable, by assigning the value of
Variable_1 .
So, it will
Hello,
And this:
get(MyList[[1]]) with [[ ]] instead of [ ] ?
If you do for example:
MyList - list()
MyList [length(MyList )+1]- MyVar
MyVar - c(1:10)
get(MyList[[1]])
It seems to do what you want
--
View this message in context:
Yes. Thank you. This is what I wanted. Thanks !
From: jeff6868 [via R] [mailto:ml-node+s789695n4641563...@n4.nabble.com]
Sent: Tuesday, August 28, 2012 7:03 PM
To: Akkara, Antony (GE Energy, Non-GE)
Subject: Re: Get variable data Reading from the list
Hello,
And this:
get(MyList[[1]])
Yes, this is it (as would say michael)! Thank you guys!
Last question about another function on this list: imagine this list is my
data after your function for the regression model:
mydf - data.frame(x=c(1:5), y=c(21:25),z=rnorm(1:5))
mylist - rep(list(mydf),5)
Don't care about this fake data,
Hello,
You can try this:
x=seq(-3,0,length=30)
y=1/sqrt(2*pi)*exp(-x^2/2)
plot(x,y,type=l,lwd=2,col=red)
with:
x: your vector between -3 and 0 (you can choose the length of your vector)
y: the probability density function for the standard normal distribution
formula
--
View this message in
Thank you.
From: arun kirshna [via R]
[mailto:ml-node+s789695n4641565...@n4.nabble.com]
Sent: Tuesday, August 28, 2012 7:25 PM
To: Akkara, Antony (GE Energy, Non-GE)
Subject: Re: Get variable data Reading from the list
Hi,
MyList-list()
MyList[[MyVar]]-c(1:10)
MyList[[1]]
# [1] 1
William, David, and Peter,
Thank you all so much for your help on this. Though I had read the help files
on 'subset' and '[', I had not been able to discern from that text what the
problem was. I could not have solved it without your help.
The help file on 'subset' mentions For ordinary
I suddenly started getting the error message below.
Not sure why. If I type intalled.packages() it
shows Matrix and lme4 installed. Can someone tell
what's going on and what I need to do to remedy the
problem? I'm running on a Linux box.
Loading required package: Matrix
Loading
Hi,
Try this:
test$A-(test$A==test$C)*test$E
test$B-(test$B==test$D)*test$F
test
# A B C D E F
#1 0 0 c d 40 30
#2 20 0 a b 20 10
#3 0 30 y m 50 30
^
within(test,{A-(A==C)*E; B-(B==D)*F})
# A B C D E F
#1 0 0 c d 40 30
#2 20 0 a b 20 10
#3
Hello,
I am receiving a 'Permission Denied' error when trying to use the R Download
funtion.
I am wondering if this is a:
- Error in the code
- Permissions issue at source
- Permissions issue at destination.
If you could shed any light on this it would be very much appreciated, below
is a
Hi,
Try this:
set.seed(1)
dat1-data.frame(A=sample(letters[20:25],replace=TRUE),B=sample(letters[1:6],replace=TRUE),C=c(letters[1:3],letters[3:1]),D=sample(letters[2:7],replace=TRUE),E=sample(letters[21:26],replace=TRUE))
newdat-list()
for(i in 1:ncol(dat1)){
newdat[[i]]-list()
Hi,
Try this:
dat1-readLines(textConnection(
ID Name Fav_Place
101 Andrew Phoenix,AZ
201 John SanFrancisco
303 Julie California/New York
304 Monica New York))
gsub(Phoenix,Tucson,gsub(New York,New York City,dat1))
#[1] ID Name Fav_Place 101 Andrew Tucson,AZ
googling R unzip files gives this as the first hit:
http://stackoverflow.com/questions/3053833/using-r-to-download-zipped-data-file-extract-and-import-data
Dirk's answer should get you started, but note that there are
different zip protocols, so you might need to modify for your data.
Cheers,
Hello,
I am a student of Materials Engineering and I want to minister an
introductory course of R at the university I study here in Brazil. I know R is
a free software, but I just want to know if I do need a special authorization
for doing it. The course will be totaly free and I also will
On 28-08-2012, at 16:57, TwistedSkies wrote:
Hello,
I am receiving a 'Permission Denied' error when trying to use the R Download
funtion.
I am wondering if this is a:
- Error in the code
- Permissions issue at source
- Permissions issue at destination.
If you could shed any light
Dear Pedro
in your R session, enter the commands
license()
RShowDoc(COPYING)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Those imply no restriction on charging a fee for presenting courses in R.
albyn
On 28/08/2012 10:31 AM, Scott Raynaud wrote:
I suddenly started getting the error message below.
Not sure why. If I type intalled.packages() it
shows Matrix and lme4 installed. Can someone tell
what's going on and what I need to do to remedy the
problem? I'm running on a Linux box.
I am not a lawyer, and you should not ask for such advice on the Web. However,
if you read the GNU license, it does not mention such activities. Money is not
traditionally the issue with free software... the obligation to pass the source
along if you change it is. I have personally taken a
Now, MyDataFrame is a variable and containing some
values in that.
And Now, the problem what is I need to do rbind into the
variable
MyDataFrame .
I tried to do,
rbind(as.character(Variable_1),
data.frame(read.csv(c:\\My2ndData.csv)))
The above code will try to rbind
Hi Tom:
Sorry for top-posting. My bad etiquette for the day. The order that you do
things when you create nercdf files matters a lot. Here is a section from the
help for ncdf4:
If you want to WRITE data to a new netCDF file, the procedure is to first
define the dimensions your data array
Ahhh that makes sense now.
I figured that the name would be that of the file you were downloading.
Feel a bit stupid now, many thanks!
--
View this message in context:
http://r.789695.n4.nabble.com/R-Download-Permission-Denied-tp4641568p4641582.html
Sent from the R help mailing list
Hello all,
I have been using R for about 3 weeks and I am frustrated by a problem. I have
read R in a nutshell, scoured the internet for help but I either am not
understanding examples or am missing something completely basic. Here is the
problem:
I want to plot data that contains dates on
Others have mentioned assign and get, but generally when the answer to
a question is assign it means that you are asking the wrong question
(see fortune(236)).
This is actually FAQ 7.21, the most useful part of the answer in the
FAQ is the last few lines.
If you tell us more about what you are
Hi @ all,
I have a problem concerning the barplot (barchart lattice) of a dataframe. I
work with the attached dataframe.
When I try to plot this dataframe I only get two rows plottet. When I try
to plot the whole dataframe, there is message, that it is 'height' must be a
vector or a matrix.
On
Though, for the record, it is perfectly legal and rather common to
charge for _instruction_ in R, just not for R itself.[1] This is done,
inter alia, at the UserR conferences. Similarly, one could charge for
books on R (physical or digital), for code deliverables in R, etc.
Cheers,
Michael
[1]
HI,
Try this:
Variable_1-MyDataFrame
set.seed(1)
assign(Variable_1,sample(1:5,replace=TRUE))
assign(Variable_1,rbind(get(Variable_1),1:5))
get(Variable_1)
# [,1] [,2] [,3] [,4] [,5]
#[1,] 2 2 3 5 2
#[2,] 1 2 3 4 5
A.K.
- Original Message -
From:
On 28/08/2012 9:42 AM, Pedro Henrique Lamarão Souza wrote:
Hello,
I am a student of Materials Engineering and I want to minister an
introductory course of R at the university I study here in Brazil. I know R is
a free software, but I just want to know if I do need a special authorization
On Aug 27, 2012, at 19:15 , BrutishFruit wrote:
Hi David.
I mean that I want to get the *standard error of the predicted means* (which
is a type standard deviation, if I have understand everything right), which
the se.fit switch mentioned above should require from the predict()
function.
Dear all
Suppose the object below:
require(Hmisc)
require(plyr)
x - dlply(iris, .(Species), describe)
How can I print the object without displaying the attributes? I
inspected ?print and ?print.default with no luck.
x
$setosa
x[, Sepal.Length]
n missing uniqueMean .05 .10
No data is attached. The R-help list usually strips out attachments to prevent
viruses or malware spreading.
Use dput to include the data . Just do : dput(mydata) and copy the results into
your email.
Also it is a good idea to include the code that you are using.
John Kane
Kingston ON
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Norbert Skalski
Sent: Tuesday, August 28, 2012 9:49 AM
To: r-help@r-project.org
Subject: [R] date in plot, can't add regression line
Hello all,
I have been using R for
On 28/08/2012 1:12 PM, Liviu Andronic wrote:
Dear all
Suppose the object below:
require(Hmisc)
require(plyr)
x - dlply(iris, .(Species), describe)
How can I print the object without displaying the attributes? I
inspected ?print and ?print.default with no luck.
Assign a class to the object,
On 2012-08-28 10:34, Duncan Murdoch wrote:
On 28/08/2012 1:12 PM, Liviu Andronic wrote:
Dear all
Suppose the object below:
require(Hmisc)
require(plyr)
x - dlply(iris, .(Species), describe)
How can I print the object without displaying the attributes? I
inspected ?print and ?print.default
First of all, a practical way to supply data is to use the function dput()
Just do dput(mydata) and copy and paste the results into your email. The
reader can copy and paste into R and have an identical data set.
I am not sure I have followed exactly what you are doing but here is something
On 2012-08-28 07:44, Mauricio Cornejo wrote:
William, David, and Peter,
Thank you all so much for your help on this. Though I had read the help files
on 'subset' and '[', I had not been able to discern from that text what the
problem was. I could not have solved it without your help.
The
Hello,
Inline.
Em 28-08-2012 18:23, Nordlund, Dan (DSHS/RDA) escreveu:
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Norbert Skalski
Sent: Tuesday, August 28, 2012 9:49 AM
To: r-help@r-project.org
Subject: [R] date in plot,
On Tue, Aug 28, 2012 at 7:34 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
Assign a class to the object, and write a print method for it.
For example, this doesn't quite do what you want, but it's a start:
print.noattributes - function(x, ...) {
attributes(x) - NULL
print(x)
}
On Tue, Aug 28, 2012 at 1:16 PM, Liviu Andronic landronim...@gmail.com wrote:
On Tue, Aug 28, 2012 at 7:34 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
Assign a class to the object, and write a print method for it.
For example, this doesn't quite do what you want, but it's a start:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x - vector(length=1)
}
ls()
will print i and x.
this means that at the end of the for loop body I have to write
rm(x)
gc()
is there a more elegant way to handle this?
Thanks.
--
Sam Steingold
On Tue, Aug 28, 2012 at 1:29 PM, Sam Steingold s...@gnu.org wrote:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x - vector(length=1)
}
ls()
will print i and x.
this means that at the end of the for loop body I have to write
rm(x)
gc()
is
Hello,
Maybe local().
Continue your example with
#?local
local(for (i in 1:10) {
x - vector(length=1)
})
ls() # not 'i' nor 'x'
Hope this helps,
Rui Barradas
Em 28-08-2012 19:29, Sam Steingold escreveu:
At the end of a for loop its variables are still present:
for (i in 1:10) {
Perhaps I'm dense, but huh*?
-- Bert
*e.g. What are you trying to do? R does it's own garbage collection --
why do you think you need it?
And, as a general comment which may or may not be applicable, if you
create variables in a function they are local only to the function --
they disappear once
On Tue, Aug 28, 2012 at 1:37 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
On Tue, Aug 28, 2012 at 1:29 PM, Sam Steingold s...@gnu.org wrote:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x - vector(length=1)
}
ls()
will print i and x.
On Aug 28, 2012, at 1:29 PM, Sam Steingold s...@gnu.org wrote:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x - vector(length=1)
}
ls()
will print i and x.
this means that at the end of the for loop body I have to write
rm(x)
gc()
is
On 28/08/2012 2:29 PM, Sam Steingold wrote:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x - vector(length=1)
}
ls()
will print i and x.
this means that at the end of the for loop body I have to write
rm(x)
gc()
is there a more elegant way to
On 28/08/2012 2:16 PM, Liviu Andronic wrote:
On Tue, Aug 28, 2012 at 7:34 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
Assign a class to the object, and write a print method for it.
For example, this doesn't quite do what you want, but it's a start:
print.noattributes - function(x,
Hello,
You should say which package you are getting 'corrgram' from. I'll
assume it's from package corrgram.
The answer to your question is not in the help page but part of it is,
it says it calls function 'col.corrgram'.
And R is open source so a quick look at the package *.R sources (only
Hi,
I have revised my package cwhmisc and want to re-submit it (meeting a
deadline soon). One big stumbling stone is the 'sudden' appearance of
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] C
attached base packages:
[1] tools
Sample data? Some representative sample data really is needed to see what you
are doing. Have a look at dput() for a handy way to present data.
Also where did theme_complete_bw come from? Is it a special formattng
function?
John Kane
Kingston ON Canada
-Original Message-
You could try running the dependency checker function directly and
then using the usual R debugging tools to start tracking down the problem.
E.g., I have a package in ~/packages/foo with a bogus entry in
the Depends line of DESCRIPTION:
tools:::.check_package_depends(dir=~/packages/foo)
Package
On Aug 28, 2012, at 12:24 PM, Tom Roche wrote:
Roy Mendelssohn Tue, 28 Aug 2012 09:07:32 -0700
here is the relevant section from your code:
netcdf.file - nc_create(
filename=netcdf.fn,
# vars=list(emis.var),
# verbose=TRUE)
vars=list(emis.var))
# Write data to data variable:
Pascal Oettli: MERCI BEAUCOUP! (though I would have thanked you
earlier if I hadn't had to dig through the r-help digest first :-)
Tom Roche Mon, 27 Aug 2012 23:31:23 -0400
summary: I can successfully ncvar_put(...) data to a file, but when
I try to ncvar_get(...) the same data I get
Error
- Nothing about the error text (IMHO) would lead one to the fix.
(Note also that neither ncvar_put or nc_close appear to require
assignment, which is probably what made me think I could nc_open
without assignment.)
Can ncdf4 be made to fail more helpfully? E.g., to fail immediately on
Is there a function to efficiently search for a subsequence within a vector?
For example, with
x - 1:100
I'd like to search for the sequence c(49,50,51), and be told that it
occurs exactly once, starting at location 49. (The items in the vectors
might be numeric or character, and there
On Aug 28, 2012, at 4:05 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote:
Is there a function to efficiently search for a subsequence within a vector?
For example, with
x - 1:100
I'd like to search for the sequence c(49,50,51), and be told that it occurs
exactly once, starting at
Hello,
Try the following.
occur1 - function(pat, vec){
m - length(pat)
n - length(vec)
candidate - seq.int(length=n-m+1)
for (i in seq.int(length=m))
candidate - candidate[pat[i] == vec[candidate + i - 1]]
candidate
}
patrn - c(1,2,3,4)
exmpl -
* R. Michael Weylandt zvpunry.jrlyn...@tznvy.pbz [2012-08-28 13:45:35
-0500]:
always you shouldn't need manual garbage collection.
my observation is that gc in R sucks.
(it cannot release small objects).
this is not specific to R; ocaml suffers too.
since a loop doesn't define its own
Thanks, when will I be able to use the new code?
I just did install.packages(e1071) + library(e1071). no good.
do I need to restart R?
thanks!
* David Meyer qnivq.zr...@jh.np.ng [2012-08-27 22:57:17 +0200]:
done, thanks for the suggestion.
On 2012-08-27 21:15, Sam Steingold wrote:
David,
Thanks for all help so far!
And I seems as you are correct Peter (and Jean too).
And I have now investigated and found how it is connected with the standard
errors:
If use the following code (taking from Jeans example code), where we have
one manova and two individual models (continue read
Roy Mendelssohn Tue, 28 Aug 2012 09:07:32 -0700
here is the relevant section from your code:
netcdf.file - nc_create(
filename=netcdf.fn,
# vars=list(emis.var),
# verbose=TRUE)
vars=list(emis.var))
# Write data to data variable: gotta have file first.
# Gotta convert 2d
HI,
You can also try this:
Students1-data.frame(ID=c(101,201,303,304),Name=c(Andrew,John,Julie,Monica),Fav_Place=c(Phoenix
AZ,San Francisco,California/New York,New York))
gsubfun-function(pattern,replacement,x, ...){
for(i in seq_along(pattern))
x-gsub(pattern[i],replacement[i],x,...)
x
}
Here's the sessinoInfo(). I didn't do the upgrade and I don't
know how to interpret the output.
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8
HI,
Try this:
test-read.table(text=
A B C D E F
a b c d 40 30
a f a b 20 10
x m y m 50 30
,sep=,header=TRUE,stringsAsFactors=FALSE)
#Here, stringsAsFactors=FALSE is the key here. If you did not add that (or
=TRUE) , by default, A-D columns will be factors and you will get the error
message
I would like to efficiently find the first index of each unique value in a
very large vector.
For example, if I have a vector
A-c(9,2,9,5)
I would like to return not only the unique values (2,5,9) but also their
first indices (2,4,1).
I tried using a for loop with which(A==unique(A)[i])[1] to
I was wondering if there was an R equivalent to the two phased approach that
MATLAB uses in performing the Kmeans algorithm. If not is there away that I
can determine if the kmeans in R and the kmeans in MATLAB are essentially
giving me the same clustering information within a small amount of
The listserver is very good about passing on attachments IF AND ONLY IF they
are text or an acceptable image format.
--
David
Sent from my iPhone
On Aug 28, 2012, at 11:17 AM, John Kane jrkrid...@inbox.com wrote:
No data is attached. The R-help list usually strips out attachments to
1 - 100 of 139 matches
Mail list logo