Re: [R] an apply question

2013-01-19 Thread David Winsemius
On Jan 18, 2013, at 9:17 PM, m p wrote: Hello, It should be easu but I cannot figure out how to use apply function. Unless this is a homework question then using `apply` seems inefficient. I am trying to replace negative values in an array with these values + 24. Would appreciate help.

Re: [R] How to re-project ease( Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?

2013-01-19 Thread Barry Rowlingson
On Fri, Jan 18, 2013 at 5:11 PM, Jonsson amen.alya...@bordeaux.inra.fr wrote: -raster(C:\\Users\\aalyaari\\Desktop\\SM_RE01_MIR_CLF31D_20100812T00_20100812T235959_246_001_7.nc, varname = Soil_Moisture) d: class : RasterLayer dimensions : 586, 1383, 810438

[R] import data (txt) separated by many blank spaces and lines with variable names that correspond to multiple observations.

2013-01-19 Thread mary
Hello, I have read other posts and in part I tried to solve my problem. I have a txt file but the values ​​as well as being separated by many blank spaces and lines eg.var_a var_b var_c 1 2 4 5

Re: [R] importing large datasets in R

2013-01-19 Thread Wensui Liu
take a look at ff package On Jan 19, 2013 7:04 AM, gaurav singh gauravonlin...@gmail.com wrote: Hi Everyone, I am a little new to R and the first problem I am facing is the dilemma whether R is suitable for files of size 2 GB's and slightly more then 2 Million rows. When I try importing the

Re: [R] importing large datasets in R

2013-01-19 Thread Duncan Murdoch
On 13-01-19 3:28 AM, gaurav singh wrote: Hi Everyone, I am a little new to R and the first problem I am facing is the dilemma whether R is suitable for files of size 2 GB's and slightly more then 2 Million rows. When I try importing the data using read.table, it seems to take forever and I have

[R] calculating mean matrix

2013-01-19 Thread ya
Hi list, Thank you vey much for reading this post. I have a data frame, I am trying to split it into a couple of data frame using one of the columns, say, x. After I get the data frames, I am planning to treat them as matrices and trying to calculate an element by element mean matrix. Could

Re: [R] calculating mean matrix

2013-01-19 Thread David L Carlson
I'm not sure I understand your question. It is always better to use an example: set.seed(42) dataN - array(sapply(1:5, function(i) assign(paste0(data,i), + matrix(rnorm(6), 2, 3))), c(2, 3, 5)) meanmtrx - apply(dataN,1:2,mean) meanmtrx [,1] [,2] [,3] [1,]

Re: [R] How to re-project ease( Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?

2013-01-19 Thread Jonsson
In fact,it is netcdf file(even if the extension is DBL). I am new to prjections and i just tried that spTransform,I did not know projectraster. Could you please tell me what is the command using project raster.I wonder if you have tried to re-project the file? -- View this message in context:

[R] Need help with Wavelet transformation

2013-01-19 Thread Simonas Kecorius
Dear R users, I am trying to perform a Wavelet transformation for time series data. I found R package called: wavelets. But as far as I have tried - no luck. I need to get something like that: http://www.jssm.org/combat/2/5/fig1.gif Maybe some of you are familiar with this problem? Thanks for

Re: [R] Hclust tree to Figtree w/ branch lengths

2013-01-19 Thread Julian Banchier
Hi, This worked: fit - hclust(d, method=ward) library(ape) p - (as.phylo(fit)) write.tree(p, file=MyNewick.tre) Cheers, J -- View this message in context: http://r.789695.n4.nabble.com/Hclust-tree-to-Figtree-w-branch-lengths-tp4655990p4656057.html Sent from the R help mailing list archive

Re: [R] Tinn-R and R problem

2013-01-19 Thread Rui Barradas
Hello, This seems to be a Tinn-R question, to be addressed to its team, not to R-Help. Anyway, since you're using R 2.12.1, maybe the error goes away if you update your version of R. Hope this helps, Rui Barradas Em 19-01-2013 04:30, Roslina Zakaria escreveu: Dear r-users, Actually, this

Re: [R] Tinn-R and R problem

2013-01-19 Thread Bert Gunter
Yes, Rui. And, even more, the Tinn-R docs explain what to do and there's even a Tinn-R menu item (R --Configure -- Permanent) that should fix the matter. For manual configuration of such things in R, see (in R) ?Startup -- Bert On Sat, Jan 19, 2013 at 8:28 AM, Rui Barradas

[R] Deformulation and R

2013-01-19 Thread Lorenzo Isella
Dear All, I hope this is not too off-topic. Essentially, I need to know if there is any R package which can help me with a deformulation project. Suppose e.g. that you know from a chemical analysis the fat, mineral, vitamin, energy [and so on] content of a certain food product. You also know

Re: [R] Deformulation and R

2013-01-19 Thread Jeff Newmiller
Algebra 1? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead:

Re: [R] Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.

2013-01-19 Thread Ben Bolker
Yoav Avneon Avneony at bgu.ac.il writes: I have conducted an experiment in order to examine predation pressure in the surroundings of potential wildlife road-crossing structures. I have documented predation occurrence (binary…) in these structures and calculated several possible explanatory

Re: [R] calculating mean matrix

2013-01-19 Thread Arunkumar Srinivasan
One way using `Reduce`: set.seed(45) grp - factor(rep(letters[1:10], each=10)) # equivalent of your column x # dummy data df - as.data.frame(matrix(sample(1:1000, replace=T), ncol=length(levels(grp # solution Reduce('+', split(df, grp))/length(levels(grp)) Arun On Saturday, January

[R] Merge 2 columns into 1 column

2013-01-19 Thread qt2hot4u
Hey everyone, I just can’t wrap my head around this problem: I got 2 Columns with 4 columns. They basically look like this: 1 2 3 4 … … … … I want to merge the two CSVs into a two-column list, which should look like this: 1 3 2 4 … … … … This is what I came up with so far:

[R] Is it possible to create color ramp legend in spplot for discontinuous data ?

2013-01-19 Thread Jd Devkota
Hello All, I have a discontinuous dataset and I used spplot to plot the points. I was wondering whether it is possible to show the legend of the plot as color ramp. I saw that on continuous data. If anyone could tell me that would be great. Another thing I would like to know is how can we

Re: [R] calculating mean matrix

2013-01-19 Thread ya
Dear Arun and David, Thank you very much for the response. Arun's code works. Thank you very much. David, I am sorry that I did not quite get the mean of your code, but still, thank you very much for helping. Best regards, ya -Original Message- From: r-help-boun...@r-project.org

[R] Doing mixed stock analysis with predict function using DFA

2013-01-19 Thread Melanie Zoelck
Dear R Help Mailing List Members, I have some baseline data (attached) on which I plan to run a DFA in R to find out the best predictor variables that best allow discrimination between the different stocks. I then need to apply this DFA function to the mixed data set (attached), which contains

[R] dummy encoding in metafor

2013-01-19 Thread Alma Wilflinger
Hi, I am quite new to R and in need of some advice. I am trying to conduct a meta regression over a some studies with about 7 mod variables which I have to dummy encode. I have found the following piece of code in the manual for the metafor library: ### manual dummy coding of the allocation

[R] Cluster Analysis and PCoA (mixt variables)

2013-01-19 Thread Julien Mvdb
Hello everyone, I mail you because of my lake of knowlegde regarding statistics. I'm using the CA and PCoA (but maybe should I use some other techniques) to determine the differences and similarities between a large sample of plants using different kind of traits through matrix of mixte

Re: [R] Merge 2 columns into 1 column

2013-01-19 Thread David Winsemius
On Jan 19, 2013, at 8:08 AM, qt2ho...@gmail.com wrote: Hey everyone, I just can’t wrap my head around this problem: I got 2 Columns with 4 columns. OK, this is simply incoherent. They basically look like this: 1 2 3 4 … … … … I want to merge the two CSVs into a two-column list,

[R] a confidence interval from an ANOVA model

2013-01-19 Thread Erin Hodgess
Dear R People: I have a data set with trt and resp: trt resp A 23 A 28 A 37 A 30 B 37 B 44 B 31 B 35 C 42 C 47 C 52 C 38 And I did read.table, constructed an aov object and ran the summary on the aov object. I also ran the TukeyHSD function. All is well so far. My question is: is there a way

[R] Fwd: a confidence interval from an ANOVA model solved

2013-01-19 Thread Erin Hodgess
Just use confint -- Forwarded message -- From: Erin Hodgess erinm.hodg...@gmail.com Date: Sat, Jan 19, 2013 at 8:11 PM Subject: [R] a confidence interval from an ANOVA model To: R help r-h...@stat.math.ethz.ch Dear R People: I have a data set with trt and resp: trt resp A 23

Re: [R] calculating mean matrix

2013-01-19 Thread arun
Hi, This could be also done by: #Using Arun's example:  res- Reduce('+', split(df, grp))/length(levels(grp)) res  #     V1    V2    V3    V4    V5    V6    V7    V8    V9   V10 #1  417.3 792.2 504.2 506.1 513.9 480.7 545.4 564.4 473.7 486.2 #2  585.8 416.6 409.5 417.8 480.1 586.4 436.1 615.1

Re: [R] Is it possible to create color ramp legend in spplot for discontinuous data ?

2013-01-19 Thread Ista Zahn
Hi Janesh, I'm going to ask you the same thing you were asked when you posted this question on the r-sig-Geo list: What is data1? Please give us the output of dput(data1), or make another example that we can reproduce. Best, Ista On Sat, Jan 19, 2013 at 7:16 AM, Jd Devkota

Re: [R] Merge 2 columns into 1 column

2013-01-19 Thread arun
HI, Not clear what you are trying to do: set.seed(25) df1-as.data.frame(matrix(sample(1:40,20,replace=TRUE),ncol=4)) set.seed(15) df2-as.data.frame(matrix(sample(1:40,20,replace=TRUE),ncol=4))  do.call(rbind,lapply(list(df1,df2),`[`,c(2,4))) #   V2 V4 #1  40  6 #2  26 22 #3  14 30 #4   3 20 #5 

[R] Data interpolation using R from the user given data

2013-01-19 Thread Jd Devkota
I have a time series of more than 2500 points. I also have observed data set but it is not continuous. I want to use the observed data set and find out the modeled data from the time series data. After the modeled data has been found out for the same time I want to plot the correlation plot and

Re: [R] select rows with identical columns from a data frame

2013-01-19 Thread Sam Steingold
* Rui Barradas ehvconeen...@fncb.cg [2013-01-18 21:02:20 +]: Try the following. complete.cases(f) apply(f, 1, function(x) all(x == x[1])) thanks, this works, but is horribly slow (dim(f) is 766,950x2) -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000

Re: [R] select rows with identical columns from a data frame

2013-01-19 Thread Bert Gunter
But David W. and Bill Dunlap gave you solutions that also work and are much faster, no?! -- Bert On Sat, Jan 19, 2013 at 9:41 PM, Sam Steingold s...@gnu.org wrote: * Rui Barradas ehvconeen...@fncb.cg [2013-01-18 21:02:20 +]: Try the following. complete.cases(f) apply(f, 1, function(x)