Re: [R] Fastest way to extract rows of smaller matrix many times by index to make larger matrix? and multiply columsn of matrix by vector

2021-09-14 Thread nevil amos
doing it at all if you fold V2 into a matrix instead. Did you mean to use > matrix multiplication in your calculation of M3? > > On September 13, 2021 11:48:48 PM PDT, nevil amos > wrote: > >Hi is there a faster way to "extract" rows of a matrix many times to for a

[R] Fastest way to extract rows of smaller matrix many times by index to make larger matrix? and multiply columsn of matrix by vector

2021-09-14 Thread nevil amos
-(microbenchmark( M2<-M[V,], M3<-M2*V2, times=5,unit = "ms")) thanks for any suggestions Nevil Amos [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/ma

[R] shinyFiles update shinySaveButton filename varaible from server

2021-06-04 Thread nevil amos
Is it possible to update the filename variable the shinySaveButton from the server? I want to provide a default filename based on a series of choices that the user has made in the app ( here I have just made a random string to serve the purpose. how do I feed output$defaultname so that

[R] setting wd to parent directory ("..") of rmd file for all chunks of .Rmd

2021-03-24 Thread nevil amos
emonstrate the result. There is no change in the directory. How do I change the working directory ? thanks nevil Amos [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.

[R] using aws.s3::s3 sync to dowlaod files from public s3 Bucket without credentials?

2021-03-21 Thread nevil amos
t; message. Should it be possible to "see" and use Sys.setenv("AWS_DEFAULT_REGION" =MYDEFAULTREGION) aws.s3::s3sync (path ="./", bucket=MYBUCKETNAME,check_region = F,direction = "download") to download the bucket contents without providing a keypair where both b

Re: [R] Plot_ly bar plots - bars span sevral x values when there are missing values.

2021-03-18 Thread nevil amos
Hi Rasmus, thanks for that suggestion. It does indeed fix the column widths in this example. the reason it does this is becuase it means that the additonal 0 values added result in values for two adjacent columns. so if adjacent columns are present the "correct" column width is maintained

[R] Plot_ly bar plots - bars span sevral x values when there are missing values.

2021-03-08 Thread nevil amos
I need to plot a number of bar charts as part of a shiny app. I am using ploty ly x and y values are both numeric x being consecutive integer values. there are often missing values in the data I wish to plot - each plot needs to have a fixed x range. When there are more than a few missing

Re: [R] [R-sig-Geo] raster::levels() not working in packaged function.

2020-10-31 Thread nevil amos
; import(raster) > > or > > importFrom("raster", "levels") > > in the package NAMESPACE would help. > > Cheers, > > Marcelino > > El 31/10/2020 a las 13:24, nevil amos escribió: > > Apologies, I cannot see how to make a rero for this issue. &g

[R] raster::levels() not working in packaged function.

2020-10-31 Thread nevil amos
'namespace:raster' I have also tried just using levels(r) and putting raster as a depends rather than an import in the DESCRIPTION file for the package, this does not solve the error. Any suggestions on how to overcome the problem? many thanks Nevil Amos [[alternati

[R] Return filematrix column by column names instead of column index?

2020-09-08 Thread nevil amos
n? FM[,grep("one",colnames(FM))] FM[,c(grep("one",colnames(FM)),grep("three",colnames(FM)))] many thanks for any suggestions Nevil Amos [[alternative HTML version deleted]] __ R-help@r-project.org mailing list --

[R] aws.s3::s3sync Error in curl::curl_fetch_disk(url, x$path, handle = handle) : Failed to open file

2020-07-16 Thread nevil amos
trying to sync are under the s3 prefix FAME_FMR which is the only top level "directory" in the bucket Have I missed a setting? If not any suggestions on this error? thanks Nevil Amos library(aws.s3) Sys.setenv("AWS_ACCESS_KEY_ID" = "x",

[R] disk.frame change default directory that disk.frames are saved in?

2020-04-02 Thread nevil amos
I would like to change the default directory within which all disk frames are saved to a directory on an SSD, which is not the drive there the r tempdir is located. for example instead of saving all disk.frames in tempdir the are all saved in ./media/SSDdrive/DF? Thanks [[alternative

Re: [R] repeat rows of matrix by number (k) in one colummatrix adding column j with values 1:k

2020-03-31 Thread nevil amos
e(M[,4]) MOut<-cbind(MOut,j) colnames(Mout)<-c("x","y","z","j") })) On Wed, 1 Apr 2020 at 13:42, nevil amos wrote: > Well, > I found a way to do it partly using rep(), and one loop that makes it 10x > or more faster however would still be

Re: [R] repeat rows of matrix by number (k) in one colummatrix adding column j with values 1:k

2020-03-31 Thread nevil amos
rep(1:nrow(M), times = M[,4]), ] for(i in M[,4])(j<-c(j,1:i)) MOut<-cbind(MOut,j) colnames(Mout)<-c("x","y","z","j") })) On Wed, 1 Apr 2020 at 12:18, nevil amos wrote: > Hi > > I can achieve this using two for loops but it is slow I

[R] repeat rows of matrix by number (k) in one colummatrix adding column j with values 1:k

2020-03-31 Thread nevil amos
his is very slow ( example below) #How do I acheive this quickly without loops? Mout<-NULL for(i in 1:nrow(M)){ a=M[i,c("x","y","z")] for (j in 1:M[i,"k"]){ b=c(a,j) Mout<-rbind(Mout,b) } } colnames(Mout)[4]<-"j" print(Mout)

[R] Cannot view custom tiles made in package tiler in r leaflet - either locally or from github pages server.

2020-02-05 Thread nevil amos
I wish to create tiled version of a large number of custom rasters for viewing in shiny/leaflet apps ( to speed viewing of rasters) I have produced tiles using package tiler, these can be viewed in the preview.html, but when uploaded to github pages as described in the introduction to tiler

[R] reg expr that retains only bracketed text from strings

2019-06-11 Thread nevil amos
t;) substring(mystrings, regexpr("\\(|\\)", mystrings)) #this returns the whole string if there are no brackets. [1] "ABC" "(B)C" "(C)" # my desired desired output: #[1] "" "(B)" "(C)" many thanks for any suggestions Nevil Amos

[R] profvis function parse_rprof not being loaded

2019-02-27 Thread nevil amos
I have loaded the profvis library but the function parse_ rprof() is absent. below is the session info show the absence of the function ( which is listed in the package help for the current version.) Documentation for package ‘profvis’ version 0.3.5 DESCRIPTION file. Help Pages parse_rprof

[R] Mapedit::selectMap in shiny map.

2018-02-22 Thread nevil amos
I would like to select polygons from an existing spatial polygon data set interactively in a shiny leaflet map. The process is straightforward in leaflet/ mapedit, however I need to include the procedure in a shiny app map interface. I cannot work out how to incorporate the selectMap() in the

[R] Identifying attributes of specific foreach task on error.

2015-11-10 Thread nevil amos
presumably there is a problem with the input or output file name, but I cannot determine which file it refers to. cheers Nevil Amos [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.

[R] clusterR (fun=aggregate) error number of items to replace is not a multiple of replacement length

2015-04-20 Thread nevil amos
I am getting the above error with clusterR and aggregate: works fine without parralell: library(raster) r-raster(matrix(data = sample(c(1:10,NA),1,replace=T),100,100),xmn=0, xmx=1000,ymn=0,ymx=1000) beginCluster()

Re: [R] clusterR (fun=aggregate) error number of items to replace is not a multiple of replacement length

2015-04-20 Thread nevil amos
Apoligies. did not read help properly it states: Among other functions, it does _not_ work with ... (dis)aggregate On Mon, Apr 20, 2015 at 4:54 PM, nevil amos nevil.a...@gmail.com wrote: I am getting the above error with clusterR and aggregate: works fine without parralell: library(raster

[R] How to run sequential Rscript command for windows command line with a batch file.

2015-01-29 Thread nevil amos
Hi, I need to run multiple iterations of a script to which I am supplying a single numeric argument I can open the command prompt window and enter a single command: C:\Program Files\R\R-3.1.0\bin\x64\Rscript.exe myScript.R.R 18 and it runs OK and saves the outputs. Similarly if I run the same

[R] Return TRUE only for first match of values between matrix and vector.

2014-05-02 Thread nevil amos
I wish to return True in a matrix for only the first match of a value per row where the value equals that in a vector with the same number of values as rosw in the matrix eg: A-matrix(c(2,3,2,1,1,2,NA,NA,NA,5,1,0,5,5,5),5,3) B-c(2,1,NA,1,5) desired result: [,1] [,2] [,3] [1,] TRUE FALSE

Re: [R] return the name of source.

2013-08-27 Thread nevil amos
:12 , nevil amos wrote: Is there a fuction that will allow me to retrun the filename for a script from within that script. Not a standard one, but you should be able to get at it via a bit of breaking and entering: sys.status() and friends (sys.calls, sys.frames) give you access

[R] return the name of source.

2013-08-26 Thread nevil amos
Is there a fuction that will allow me to retrun the filename for a script from within that script. fir instance If I have a script myscript.r: FileName-unknown.fucntion() print(FileName) and run it source(myscript.r) will return myscript.r Thanks Nevil Amos [[alternative HTML

[R] return output to console for copying as input

2013-06-25 Thread nevil amos
I want to print a vector of strings to the console formatted as if it were input X-c(a,b,c) X [1] a b c what I would like to get is the.function(X) a,b,c what is the function? cheers Nevil amos [[alternative HTML version deleted]] __ R

[R] Problem i9ncreasing memory to jvm for XLConnect

2013-06-11 Thread nevil amos
I am using some r scripts to reformat a large data set that needs to be saved into xls format. I am getting the “Out of Memory Error (Java)” despite having set a large memory in the first line of the script ( on opening R and before loading any libraries) I am using R version 2.15.2

Re: [R] Problem i9ncreasing memory to jvm for XLConnect

2013-06-11 Thread nevil amos
multiplying by 1024 :) On Tue, Jun 11, 2013 at 3:21 AM, nevil amos nevil.a...@gmail.com wrote: I am using some r scripts to reformat a large data set that needs to be saved into xls format. I am getting the “Out of Memory Error (Java)” despite having set a large memory in the first line

[R] merge without NA last

2013-05-31 Thread nevil amos
=c(A,B,C)) Z-merge(X,Y, by.x=1,by.y=2,all.x=T,sort=F) print (Z) k1 k2 1A 1 2C 3 3B 2 4 NA NA The result I need is k1 k2 1A 1 2 NA NA 3C 3 4B 2 how do I prevent NA c=values being sorted to last - I need to retain values in position. thanks Nevil Amos

[R] Default for boot in mantel{ecodist} was Re: Size of subsample in ecodist mantel()

2012-07-01 Thread Nevil Amos
0.001 0.1005011 0.1805416 many thanks Nevil Amos [[alternative HTML version deleted]] __ 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

Re: [R] Size of subsample in ecodist mantel()

2012-06-29 Thread nevil amos
0.1805416 What is the default for pboot? this does not appear to be dealt with in help for mantel On Thu, Jun 28, 2012 at 8:35 PM, Sarah Goslee sarah.gos...@gmail.comwrote: You can set it using the pboot argument. Sarah On Thursday, June 28, 2012, nevil amos wrote: What is the size

[R] Size of subsample in ecodist mantel()

2012-06-28 Thread nevil amos
What is the size of the boostrapped subsample in ecodist mantel() thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] VEGAN ordistep, stepwise model selection in CCA - familywise error correction.

2012-06-10 Thread Nevil Amos
correlated variables in the model selection process? -- Nevil Amos Molecular Ecology Research Group Australian Centre for Biodiversity Monash University CLAYTON VIC 3800 Australia [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] removing only rows/columns with na value from square ( symmetrical ) matrix.

2012-05-21 Thread Nevil Amos
) and 6. In that case you might chose to remove the smallest no. of row/cols but in 9 vs. 10, the situation is completely symmetric.) You either need to rethink what you want to do or clarify your statement of it. -- Bert On Sun, May 20, 2012 at 7:17 AM, Nevil Amos nevil.a

[R] removeing only rows/columns with na value from square ( symmetrical ) matrix.

2012-05-20 Thread Nevil Amos
-- Nevil Amos Molecular Ecology Research Group Australian Centre for Biodiversity Monash University CLAYTON VIC 3800 Australia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] How to remove $ (Dollar sign) from string

2012-04-10 Thread Nevil Amos
How do I remove a $ character from a string sub() and gsub() with $ or \$ as pattern do not work. sub($,,ABC$DEF) [1] ABC$DEF sub(\$,,ABC$DEF) Error: '\$' is an unrecognized escape in character string starting \$ sub(\$,,ABC$DEF) Error: unexpected input in sub(\ Thanks -- Nevil Amos Molecular

[R] Extracting part of anova.cca()

2012-01-23 Thread Nevil Amos
) but cannot see how to get the table with variable names included Many thanks Nevil Amos __ 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

[R] Terms with zero variance included in ordistep best model?

2012-01-23 Thread Nevil Amos
? thanks Nevil Amos myOrdistepBoth Call: rda(formula = mygenind@tab ~ mds3dCS_NULL + mds3dTRE_25_2_CS25 + mydata$LAT.x + mydata$Hab_Config + mds3dTRE_25_100_CS25 + mydata$TreeCov + mydata$Site_No + mds3dSFW_EO_100_CS25 + mds3dSFW_EO_5000_CS25 + mydata$Landscape + mds3dSFW_TH_10_CS25 + mydata$LONG.x

[R] replacing + in string

2012-01-21 Thread Nevil Amos
] one plus two How do I enable + to be recognised as a normal character? thanks Nevil Amos __ 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

[R] DEMEtics expected run time for calculating DEST CI

2012-01-19 Thread Nevil Amos
that I might expect hours to days. Have I got a setting wrong somewhere? D.Jost(filename=spp,object=T,format.table=T) many thanks Nevil Amos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Vegan(ordistep) error: Error in if (aod[1, 5] = Pin) { : missing value where TRUE/FALSE needed

2012-01-11 Thread Nevil Amos
, scope = formula(myrda1), direction = both, Pin = 0.05, Pout = 0.1)) at #55 Cheers Nevil Amos Nevil Amos nevil.amos at monash.edu writes: I am getting the following erro rmessage in ordistep. I have a number of similarly structured datasets using ordistep in a loop

[R] Error message in vegan ordistep

2012-01-10 Thread Nevil Amos
and there are several pcnm's in the rhs of the formula. thanks for any pointers that may allow me to track down the cause of the error. Nevil Amos Error in if (aod[1, 5] = Pin) { : missing value where TRUE/FALSE needed In addition: There were 50 or more warnings (use warnings() to see the first 50

[R] Vegan(ordistep) error: Error in if (aod[1, 5] = Pin) { : missing value where TRUE/FALSE needed

2012-01-10 Thread Nevil Amos
0.14733 0.12183 0.09054 0.07380 0.06971 0.05578 0.04215 (Showed only 8 of all 29 unconstrained eigenvalues) -- Nevil Amos Molecular Ecology Research Group Australian Centre for Biodiversity Monash University CLAYTON VIC 3800 Australia [[alternative HTML version deleted

[R] partial mantel tests in ecodist with intential NA values.

2011-12-03 Thread Nevil Amos
a matrix is not square error. is it possible to perform this test in ecodist? many thanks Nevil Amos library(ecodist) library(ncf) x-sample(1:1000,20) y-sample(1:1000,20) z-sample(1:1000,20) M1-as.matrix( distance(x)) M2 -as.matrix( distance(y )) M3-as.matrix( distance(z )) D1-(lower(M1

[R] How to plot CI's (llim ulim) on ecodist mgram

2011-10-16 Thread Nevil Amos
-0.334465576 0.001 -0.35500933 -0.309763543 [13,] 94.251371 43 -0.238965642 0.001 -0.26437371 -0.196038662 $resids [1] NA attr(,class) [1] mgram Thanks Nevil Amos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] How to format Rsuperscript 2 followed by = value

2011-10-03 Thread Nevil Amos
) thanks Nevil Amos __ 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.

[R] How to format R superscript 2 followed by = value

2011-10-02 Thread Nevil Amos
) thanks Nevil Amos __ 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.

[R] how to get xlab and ylab in bold?

2011-09-12 Thread Nevil Amos
A very basic query This code plots OK the axis values are in bold but the axis labels are not. how do I get them in bold too? thanks Nevil Amos plot(c(1,1),xlim=c(0,450),ylim=c(0.7,1.4),xlab=Distance (cells) from edge of grid,ylab=Resistance distance, type=l,col=white,lwd=2,font=2,family

[R] lm.fit error in scatterplot matrix

2011-06-30 Thread Nevil Amos
I am getting the following error: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases when running the command scatterplotMatrix(~THL+WL+BD+TL+Mass|SEX_,by.group=TRUE,plot.points=T,smooth=F,main=spp,) it works fine without the by group option I assume

[R] How to add label to lines()

2011-06-22 Thread Nevil Amos
I am plotting a number of lines on a standard plot. I would like to add labels at the end (rhs) of each line. is there a way to do this other than defining the individual xy coordinates and placing each label using text() Thanks Nevil Amos __ R

[R] how to assemble data frame of unknown number of columns in loop

2011-04-23 Thread Nevil Amos
How do I assemble ad data fame, consisting of columns form other data frames identified in a loop? cbind is not working as the initial data fame has 0 columns and rows. ModList-dir(./MODEL_DISTS/) ModList-ModList[grep(pattern=3COLUMNS,ModList)] ALL_MODELS-data.frame() for (i in ModList){

[R] how to keep keep matching column in output of merge

2011-01-04 Thread Nevil Amos
How do I keep the linking column[s] in a merge()? I need to use the values again in a further merge. thanks Nevil Amos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] how to keep keep matching column in output of merge

2011-01-04 Thread Nevil Amos
)) merge(x, y) id x y 1 a 1 102 2 b 2 101 3 c 3 104 4 d 4 103 Sarah On Tue, Jan 4, 2011 at 8:31 AM, Nevil Amosnevil.a...@gmail.com wrote: How do I keep the linking column[s] in a merge()? I need to use the values again in a further merge. thanks Nevil Amos

[R] Change legend position in s.value {ade4}

2010-12-17 Thread Nevil Amos
How do I change the postion of the legend in s.value {ade4} from the defaul , bootom left? thanks Nevil Amos __ 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

[R] how to change number of characters per line for print() to sink()?

2010-11-22 Thread Nevil Amos
I am using r to read and reformat data that is then saved to a text file using sink(), the file has a number of initial lines of comments and summary data followed by print of a data.frame with no row names. for example a-c(100:120) b-c(rnorm(100:120)) c-c(rnorm(200:220))

[R] filling large matrix( or dist object) with values from small matrix.

2010-11-18 Thread Nevil Amos
(N)[r],colnames(N)[c]] } } thanks Nevil Amos __ 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

[R] how to find names referring to parts of an R object. particlualry w.r.t capscale

2010-11-14 Thread Nevil Amos
such components of all objects. at the moment I would like to be able to extract the variance, p value etc for a capscle to tabulate the automatically but would also like to know if the re is a simple way to establish the way to refer to all individual sub parts of a object? thanks Nevil

[R] NA handling problem in capscale (vegan)

2010-11-10 Thread Nevil Amos
below. library(vegan) mydist- matrix(1:25, 5, 5) mydata-matrix(rnorm(1:25),5,5) mydata[3,1]-NA mydata-data.frame(mydata) capscale(mydist~X1+X2+Condition(X3),data=mydata,na.action = na.omit) Thanks Nevil Amos __ R-help@r-project.org mailing list https

[R] repeatability/intraclass with nested levels

2010-10-12 Thread Nevil Amos
at doing this with icc{irr} or using an anova approach, but I am unclear how to acheive this given that there is a nested structure- the value varies between wavelengths within individuals. Many thanks Nevil Amos data is structured thus: ANWC_NO Wavelength Repeatvalue 1 00239

[R] conditioning variables in dbRDA

2010-10-11 Thread Nevil Amos
I am using cascaple() in vegan, is it permissible to have more than one conditioning variable thus capscale(DIST~varaible1+variable2+Conditon(varaible3+variable4), data=mydata) many thanks Nevil Amos __ R-help@r-project.org mailing list https

[R] partial dbRDA or CCA with two distance objects in Vegan.

2010-09-21 Thread Nevil Amos
equivalent to the approach suggested by Legendre Fortin, (Geffen et al used DISTLM). many thanks Nevil Amos ACB Monash University references (Geffen, E., M. J. Anderson, et al. (2004). Climate and habitat barriers to dispersal in the highly mobile grey wolf. Molecular Ecology 13(8): 2481-2490

Re: [R] partial dbRDA or CCA with two distance objects in Vegan.

2010-09-21 Thread Nevil Amos
Thanks for that, just to confirm I therefore need to use: #if #geogdist is a geographic distance matrix #gen_dist is a genetic distance matrix #env_var are environmental variables mypcnm-pcnm(geogdist) mydbRDA-capscale(gen_dist~env_var+Condition(mypcnm$vectors)) cheers Nevil On

[R] how to un-crosstabulate data without changing numeric values to text?

2010-08-28 Thread Nevil Amos
in three columns but maintaining WavelENGTH and the values as numeric in a data.frame? Many thanks Nevil Amos Monash University __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] mapproject Lambert in metres

2010-06-20 Thread Nevil Amos
lattidudes are south ie negative) Many thanks Nevil Amos Monash University LONGLAT is a headerless two column file of longitude and latitude such as 141 -32 142 -35 136 -20 ## load packages require(mapproj) require(maps) ## read raw data coord.lonlat - LONGLAT ## convert (Lon,Lat) coordinates

[R] How to output text to sink without initial line number [1], and data frame line by line without column names

2010-06-13 Thread Nevil Amos
in this file so cannot use print table or similar command col1 col2 col3 a 234 B 44 C 566 Many thanks Nevil Amos __ 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

Re: [R] How to output text to sink from data frame line by line without column names

2010-06-13 Thread Nevil Amos
OK I see how to remove the line numbers[1] etc by using cat instead of print, but cannot work out how to remove the column names from the data frame output On 13/06/2010 4:21 PM, Nevil Amos wrote: I want to output a text file assembeld from various soruces within r ( actually as a genepop

[R] How to get a list of subdirectories in the wd?

2010-06-01 Thread Nevil Amos
How do I get a list of subdirectories only, not files, in a directory dir.create(test) setwd(test) dir.create(adir) dir.create(bdir) file.create(afile) dir() returns [1] adir afile bdir in need to return [1] adir bdir cheers Nevil Amos __ R

[R] Printing page nmbers in multi-page pdf

2010-05-31 Thread Nevil Amos
Is it possible to print page numbers in pdf() with multiple pages? thanks Nevil Amos __ 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

[R] warning In fun(...) : no DISPLAY variable so Tk is not available

2010-05-29 Thread Nevil Amos
I am getting the above warning following loading of Geneland 3.1.5 on unix , while a simple plot sends output to the pdf file ( see attached code) no output results from Geneland functions, resulting in empty pdf files library (Geneland) Loading required package: RandomFields Loading

[R] How to install an archived version of a package in windows

2010-05-27 Thread Nevil Amos
in the console packages menu, this does not work wither with the downlaoded tar.gz, or if I unzip it and save all its contents as Genland_3.1.5.zip in the R/bin direcotry. What do I need to do? thanks Nevil Amos __ R-help@r-project.org mailing list https

[R] Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno)

2010-05-20 Thread Nevil Amos
I am receiving the above error ( full r session output below) the script runs OK in windows. and genotypes and ploidy are both correct arguments any suggestions would be most welcome Nevil Amos MERG/ACB Monash University School of Biological Sciences library(Geneland) Loading

[R] writing string values from a matrix to a file without enclosing quotes

2010-05-07 Thread Nevil Amos
134 150 152 How might I achieve this? Thanks Nevil Amos __ 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

[R] How to replace all NA values in a data.frame with another ( not 0) value

2010-05-04 Thread Nevil Amos
I need to replace NA occurrences in multiple columns in a data.frame with 000/000 how do I achieve this? Thanks Nevil Amos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] How to replace all NA values in a data.frame with another ( not 0) value

2010-05-04 Thread Nevil Amos
) # conver to matrix y - which(is.na(dat)==TRUE) # get index of NA values dat2[y] - 000/000 # replace all na values with 000/000 Muhammad Nevil Amos wrote: I need to replace NA occurrences in multiple columns in a data.frame with 000/000

[R] using get and paste in a loop to return objects for object names listed a strings

2010-04-29 Thread Nevil Amos
I am trying to create a heap of boxplots, by looping though a series of factors and variables in a large data.frame suing paste to constrcut the facto and response names from the colnames I thought I could do this using get() however it is not working what am I doing wrong? thanks Nevil Amos

Re: [R] using get and paste in a loop to return objects for object names listed a strings

2010-04-29 Thread Nevil Amos
=response) } } detach(data.sp) } On 29/04/2010 7:05 PM, Paul Hiemstra wrote: Nevil Amos wrote: I am trying to create a heap of boxplots, by looping though a series of factors and variables in a large data.frame suing paste to constrcut the facto and response names from the colnames I thought I

[R] reduce size of pdf

2010-04-29 Thread Nevil Amos
is there a way to reduce the size of pdf files in R: ? compression? lower dpi ? or some other option? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] reduce size of pdf

2010-04-29 Thread Nevil Amos
The file is a large number of scatterplot matrices (120pp of 4x4 matrix) the individual plots may have up to several hudred points. I am already using the useDingbats but the files are still very large - I can reduce them about 50% in cute.pdf by changing the dpi setting but it would be