[R] copent - the package for estimating copula entropy

2020-07-21 Thread Ma Jian
tropy. CRAN: https://cran.r-project.org/package=copent GITHUB: https://github.com/majianthu/copent/ Hope it helpful for you. Any comments and suggestions are welcome. Best Regards, MA Jian -- References 1. Ma Jian, Sun Zengqi. Mutual information is copula entropy. Tsinghua Science & T

Re: [R] Notational derivative in R

2020-05-15 Thread Jialin Ma
Hi, There is a new package published on CRAN called symengine (I am the maintainer). That might be suitable for your need. Best, Jialin On Thursday, May 14, 2020 2:00:20 PM EDT Jeff Newmiller wrote: > FWIW I have found all such tools to require babysitting... and for > interactive use I prefer w

[R] [R-pkgs] New package: data360r to access trade and governance open data

2017-11-06 Thread Ma. Regina Paz Saquido Onglao
If you have any questions, feedback, or suggestions, I'd be more than happy to hear these. Feel free to send me an email at mong...@ifc.org. Cheers, Ma. Regina Paz S. Onglao Data Scientist Trade and Competitiveness (T&C) Global Practice World Bank Group E mong...@ifc.org W https:/

[R] How to optimizing the code for calculating the launch time

2014-08-05 Thread Lingyi Ma
My dataset: Item_IdYear_Month B65623262 201204 B58279745 201204 B33671102 201204 B36630946 201204 B63270151 201204 B63270133 201204 I have written my code to calculate one more column which is the product maturity time as the following: launchtime<-functi

[R] How to avoid the three loops in R?

2014-08-01 Thread Lingyi Ma
I have the following data set: Country Product Price Year_Month AE 1 20201204 DE 1 20201204 CN 1 28201204 AE 2 28201204 DE 2 28201204 CN 2

[R] (no subject)

2014-02-28 Thread Ma Rw
Hai There are in the r package called poLCA and this package using the latent class. Is there a package to resolve latent profile and what and how we can support the answer with an example Thank you [[alternative HTML version deleted]] __ R-h

[R] (no subject)

2014-02-08 Thread Ma Rw
Hai I'm working on a allatent profile in continuous data but I don't know what a directive. I know the special alatent class poLCA package but what package your latent profile thank you [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] How to generate a smoothed surface for a three dimensional dataset?

2013-12-06 Thread A Xi Ma
The following question is inspired by Jun's problem, which resembles some of my own problems, but goes off on a tangent about applying plot3D from Karline Soetart. On Thu, Dec 5, 2013 at 11:52 PM, Bert Gunter wrote: > > Your comment that: > > " I can see the critical point here is to find a rig

[R] How to search in each excel in my working dir and extract part information of one product in each country?

2013-03-28 Thread Tammy Ma
Hello, I have created many excel files in my working dir. each excel file contain one country's data. In the excel, I have dataframe in sheet1, where each product and its relative information is in each row as following: ProductPERetail_price_Band Country Model_Fit A -2.

[R] How to make the labels of pie chart are not overlapping?

2013-03-15 Thread Tammy Ma
I have the following dataframe: Productpredicted_MarketShare Predicted_MS_Percentage A2.827450e-02 2.8 B4.716403e-06 0.0 C1.741686e-01 17.4 D

[R] How to list the all products' information of the latest month?

2013-03-15 Thread Tammy Ma
Hi, I have data frame like this: Product PriceYear_Month PE A 100201012 -2 A 98 201101-3 A 97 201102-2.5 B 110 201101-1 B 100 201102

[R] HOw to achieve big vector times big dataframe in R?

2013-03-14 Thread Tammy Ma
HI, I have the following question: Vector a with lenght 150 A B C D. dataframe b with dim 908X150 1 1 1 1. 2 2 2 2 3 3 3 3 4 4 4 4 final result I want is the vector with length 908: A*1+B*1+C*1+D*1+. A*2+B*2+C*2+D*2+. A*3+B*3+C*3+D*

[R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?

2013-03-14 Thread Tammy Ma
HI, I have the pattern like "`Year_Month)201103`" I want to delete single quotes within double quetes. I want to change it into "Year_Month)201103" , how to do it in r? Thanks a lot. Tammy [[alternative HTML version deleted]] _

[R] Excel User interface for R

2013-03-04 Thread Tammy Ma
HI, Assume I have the data frame generated from R as the following: Product Price market_share A 10010% B 1109% C 12020% D 90 61% What I want to do is to have this kind of excel user interface by c

[R] how to delete the null elements in list

2013-01-25 Thread Tammy Ma
HI, I have the list: > suu [[1]] NULL [[2]] NULL [[3]] item_id prod 1 2 [[4]] item_id prod 1 2 2 4 how to delete all "NULL" elements from suu to get only >suu [[3]] item_id prod 1 2 [[4]] item_id prod 1 2 2 4 ?? Kind

[R] How to load data from .accdb into R?

2013-01-25 Thread Tammy Ma
HI, All, I have three dabases: analysis_tool.accdb is linked into sellout.mdb and audit.accdb. whenever I use this database, I need to firstly open "analysis_tool", then press "External data"->"Linked Table Manager" to link the other two databases. Now I want to load the data from those databa

Re: [R] How to name the elements of list

2013-01-25 Thread Tammy Ma
versité de Bourgogne > UMR CNRS/uB 6282 Biogéosciences > 6 Boulevard Gabriel > 21000 Dijon, FRANCE > +33(0)3.80.39.63.06 > ivan.calan...@u-bourgogne.fr > http://biogeosciences.u-bourgogne.fr/calandra > > Le 25/01/13 10:39, Tammy Ma a écrit : > > HI, > > > >

[R] How to name the elements of list

2013-01-25 Thread Tammy Ma
HI, I have the array list: X<-vector("list", 2) X[[1]] : data frame 1 X[[2]]: dataframe2 now i want to change index 1 and 2 into: "0-10" , "11-20" ,. finally I want to have X[["0-10"]]:dataframe1 X[["11-20"]]:dataframe2 how do I get them? Thanks a lot. Kind regards, Tammy

[R] how should I make the optional arguments in r?

2013-01-24 Thread Tammy Ma
HI, I guess I did sth wrong with the optional argument in the program. but I don't know how should I make it. in my main program: source("getelasticity_overPB.r") crossprice<-getelasticity(mydata,mydatao,"nest")$cross_p is same with crossprice<-getelasticity(mydata,mydatao)$cross_p I don't k

[R] how to combine unequal rows and columns in R

2013-01-24 Thread Tammy Ma
HI, I have the following list: crosspries $crosspries[[1]] Product Year_Month prod1 A 2012081 B 2012082 C 2012081 $crosspries[[2]] Product Year_Monthprod1

[R] How to align group based on the common values of two columns in r

2013-01-22 Thread Tammy Ma
HI, I met this problem: I have the feature data frame: Feature OS 4 2 4 1 4 3 1 2 4 1 what I want to do is to autimatically create one more column called "group": Feature OS Group

[R] Optmatch Package Question

2012-12-20 Thread MA
Hello , My optmatch package is loaded on R and otherwise running fine. I get an error after lcds successfully completes a logistic regression and I then try to obtain a propensity score: pdist <- pscore.dist(lcds) Error: could not find function "pscore.dist" Does anyone know if pscore.dist

[R] pscore.dist problem when running optmatch

2012-12-18 Thread MA
Hello My optmatch package is loaded and otherwise running fine. I get an error after lcds successfully completes logistic regression and I'm trying to obtain a propensity score: > pdist <- pscore.dist(lcds) Error: could not find function "pscore.dist" I searched the help files, other online sour

Re: [R] How to import the large dataset into R

2012-12-17 Thread Tammy Ma
does anybody can help me on this? From: metal_lical...@live.com To: r-help@r-project.org Subject: How to import the large dataset into R Date: Fri, 14 Dec 2012 11:01:03 +0300 HI, R Users, I met the following problem: I was trying to import data of one table in .accdb database into my ODBC

[R] How to import the large dataset into R

2012-12-14 Thread Tammy Ma
HI, R Users, I met the following problem: I was trying to import data of one table in .accdb database into my ODBC database for being imported into R. The table contains 1021965 records. I always got the following error msg even I change the drive: The query can not be completed. Either the

[R] How to create multiple country's data into multiple sheets of one excel

2012-12-13 Thread Tammy Ma
HI, I have large dataset of many countries. I have written the program to run through each country to generate one output for each country. I want to put the output like this: one sheet has output for one country. How do I achieve it by r. I have tried this: library(xlsx) write.xlsx(nnn, "v

Re: [R] how to aggregate the dataset

2012-12-13 Thread Tammy Ma
Really sorry for messing up. I want to transform: > product min_price max_price mean_price country price_band > 11 34 50 40 > VN 0-300 > 2210 30

[R] how to aggregate the dataset

2012-12-13 Thread Tammy Ma
HI, Sorry for messing up.. I want to transform the following dataset: product min_price max_price mean_price country price_band 11 34 50 40 VN 0-300 22 10 30 15 VN 0-300 Into: pro

[R] How to aggregate the dataset?

2012-12-13 Thread Tammy Ma
HI, I want to transform the following dataset Product Price_LC.1 Price_LC.2 Price_elasticity.1 Price_elasticity.2 Mean_Price Mean_Price_elasticity Trade_Price_Band Country 100 35 52 -4.14 -2.84 47 -3.69

[R] how to aggregate the data ?

2012-12-13 Thread Tammy Ma
HI, now I have dataset: Product Price_LC.1 Price_LC.2 Price_elasticity.1 Price_elasticity.2 Mean_Price Mean_Price_elasticity Trade_Price_Band Country 1 100 357580.1 527483.6 -4.1498383 -2.8459564 473934.0

[R] how to grep in r

2012-12-12 Thread Tammy Ma
Hi, I met this problem. Trade_Price_Band x 1 0-30 0.6237240 2 101-150 0.6743857 3 151-200 0.6778513 4 201-300 0.6640293 5 301-400 0.6630991 6 31-50 0.6314547 7 401-500 0.6776249 8 500+ 0.6557705

[R] how to assign factor level into each value

2012-12-05 Thread Tammy Ma
HI, All I met the following problem. I dont know how to handle it. Country Price 1 CN 44.25 2 CN 21.07 3 CN 92.70 4 CN 47.41 5 CN

Re: [R] map two names into one

2012-11-08 Thread Tammy Ma
Thanks. Yes. Your approach can identify: Glaxy ace S 5830 and S 5830 Glaxy ace But you can not identify using same program: Iphone 4S 16 G Iphone 4S 16G How should I solve both in same time. Kind regards,Tammy [[alternative

[R] how Can make function for selecting the products

2012-11-06 Thread Tammy Ma
HI. I make this code: getdata<-function('a','b','c' ,'d','e','f'){ drv <- dbDriver("SQLite") con<-dbConnect(drv, "sqlite.db") lt<-dbListTables(con) myf<-data.frame(NULL) for (i in 1:length(lt)) { myfile<-dbReadTable(con,lt[i]) myfile1<-myfile[-c(14:44)] myfile1$MODEL<-gsub(" ", "", myfile1$

[R] How to read all table in r using dbreadTable, autimatically read in whenever I save new table in SQLite db

2012-11-06 Thread Tammy Ma
HI, I got the problem. I use the following query to read table individually, how can I read all tables autimatically rather than typing "week42" "week33" in dbReadTable? library(RSQLite) library(sqldf) drv <- dbDriver("SQLite") con<-dbConnect(drv, "sqlite.db") dbListTables(con) #dbRemoveTabl

[R] can not read table in dbReadTable

2012-11-02 Thread Tammy Ma
> tbs<-dbListTables(con) > > tbs [1] "lowend" "time" "week30" "week33" "week39" "week42" > my.data.copy <- dbReadTable(tbs, "week42") Error in function (classes, fdef, mtable) : unable to find an inherited method for function "dbReadTable", for signature "character", "character" I have

[R] Which test should I use for comparing the change of two samples

2012-10-29 Thread Tammy Ma
Dear All, I have two samples as the following: conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63) ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33) I want to test the change of sample is same to the another one. conjps_ch<-c(1.04,0.33.) ms<-c(0.99,0.60,0.76) which test

[R] How to replace the row number for each product by real product name in as.dendrogram in cluster analysis..HELP!

2012-10-26 Thread Tammy Ma
data1<-data.matrix(newdata) # transforming the factor into different values data.use<-data1[,-c(1,2,3)] # leaving the value matrix data.dist = dist(data.use) data.hclust = hclust(data.dist) #complete linkage is used #if I plot the following one, I have too large data set(rows`=9980), can not

[R] Instrumental variables for the competitive price

2012-10-24 Thread Tammy Ma
Dear R user, I have been setting up the models for predicting the volume based on the price information of own product and competitive products. one option is to use instrumental variable to break price into two parts: one part that might be correlated with error term, and the another part tha

[R] Testing the equality of two variances

2012-10-22 Thread Tammy Ma
Dear R-User, I met the problem to test equality of variance. Two sample units: conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63) ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33) Then I use the F test to test: •Test Equality of Two Variances F test to compare two variance

Re: [R] PKPD modelling in R

2012-10-15 Thread Kozielska-Reid MA, Magdalena
eSolve. Regards, Magdalena From: Marc Schwartz [marc_schwa...@me.com] Sent: 08 October 2012 18:01 To: Kozielska-Reid MA, Magdalena Cc: r-help@r-project.org Subject: Re: [R] PKPD modelling in R On Oct 8, 2012, at 10:04 AM, "Kozielska-Reid MA, Magdale

[R] PKPD modelling in R

2012-10-08 Thread Kozielska-Reid MA, Magdalena
Dear all, I have two questions: 1. Does anyone know if nlmeODE package will work once odesolve is discontinued? If i understand well nlmeODE depends on odesolve. 2. Can anyone suggest another package I could use to fit complex PKPD models (described using differential equations) to data? Tha

[R] map two names into one

2012-09-26 Thread Tammy Ma
Dear R user: I have got the following problem: I have imported two data sets into R: one set includes price information, another one includes volume information. but I noticed the wrong data order problem in the product name, for instance, in one data set, "GALAXY ACE S 5830" in another o

[R] missing price datas before launched

2012-07-03 Thread Tammy Ma
HI, I have the price and volume data from own product and competitor's product: Year_Month Volume own product's price Volume competitor's price 1 201011 17583469.03 NA NA 2 201012 33899

[R] Day or Month difference between dates???

2012-06-01 Thread Tammy Ma
HI, R-Users: I got a questions. have been struggling so long time I have this data: > m1$Year_Month 201009 201010 201011 201101 201102 > min(m1$Year_Month) 201009 I want to calculate the following two answers, how do I program it? > difference in Month? [1] 0 1 2 4 5 >differenc

[R] survival analysis simulation question

2012-05-10 Thread Grace Ma
Hi, I am trying to simulate a regression on survival data under a few conditions: 1. Under different error distributions 2. Have the error term be dependent on the covariates But I'm not sure how to specify either conditions. I am using the Design package to perform the survival analysis using the

[R] How to import .accda database into R

2012-05-09 Thread Tammy Ma
Dear R user: How to import .accda database into R? I have tried many ways, still doesn't work. Thanks in advance. Kind regards, Tammy [[alternative HTML version deleted]] __ R-help@r-project.org mail

Re: [R] Regarding randomForest regression

2012-03-08 Thread Stefan MA (MOH)
Sent from my HTC -Original Message- From: David Winsemius Sent: Friday, 9 March 2012 12:26 AM To: shameek ghosh Cc: r-help@r-project.org Subject: Re: [R] Regarding randomForest regression On Mar 8, 2012, at 5:10 AM, shameek ghosh wrote: > Sir, > This query is related to randomF

Re: [R] How to get the date of specific value within a zoo object?

2011-08-09 Thread Richard Ma
.com> wrote: > > I'd suggest you look into the xts class and write > > require(xts) > xts = as.xts(1:5,Sys.Date()+1:5) > time(xts)[xts==3] > > By the way, your code isn't pastable for me: not sure why. > > Michael Weylandt > - Richard Ma PhD

[R] How to get the date of specific value within a zoo object?

2011-08-09 Thread Richard Ma
3? The program should return "2011-01-03". Is there a function to do this job conveniently? Regards, Richard - Richard Ma PhD student, Ecology & Remote Sensing Climate Change Cluster, Department of Environment Science University of Technology, Sydney http://everydropr.wordpress.com

Re: [R] How to pass different arguments to a function within lapply()?

2011-08-08 Thread Richard Ma
ly" >> within >> lapply() in terms of different column names? >> >> My example just tedious if the "rst" has lots of columns. So I >> wonder if >> there exist more convenient way to get this job done. >> >> Thank you. >> >> - >&g

[R] How to pass different arguments to a function within lapply()?

2011-08-08 Thread Richard Ma
st column "hsp", the "bandwidth" should be set as correspondent bandwidth. My problem is, how to pass the "bandwidth" argument to "locpoly" within lapply() in terms of different column names? My example just tedious if the "rst" has lots of colum

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Richard Ma
int(paste("sub", t, sep = '')) > > from which we can surmise that the following should work: > > for (t in 1:2) print(lst[[paste("sub", t, sep = '')]]) > > which trivially extends to: > > for (t in 1:2) print(lst[[paste(&quo

Re: [R] How to extract sublist from a list?

2011-08-03 Thread Richard Ma
Thank you so much GlenB! I got it done using your method. I'm just curious how did you get this idea? Cause for me, this looks so tricky Cheers, Richard - I'm a PhD student interested in Remote Sensing and R Programming. -- View this message in context: http://r.789695.n4.nabble.com/H

[R] Clean up Rmpi when there is a bug in the code

2011-05-31 Thread Junsheng Ma
I am currently work on a research project which requires parallel technique. I have successfully adapted an Rmpi code from the following website. http://math.acadiau.ca/ACMMaC/Rmpi/task_pull.R and be able to run my own code now. However, since I am developing my own code which involves ma

[R] Mixed Ordinal logistic regression: marginal probabilities and standard errors for the marginal probabilities

2011-05-12 Thread Ma Ya
probabilities and standard errors for the marginal probabilities. Which option in lmer would give me those two kind of values? Thank you. Ya Ma [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Executable for Production Use

2010-03-08 Thread Ma Ismail - NewYork-MEAG-NY
. Is there a way to create an executable that the users can just run without R installed on their workstation? Thanks in advance for your help. Ismail Ma Head of IT Applications MEAG New York Corporation Telephone: (212) 583-4850 Fax: (646) 521-7950 E-Mail: i...@meag-ny.com<mailto:i...@meag-ny.

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Eric Ma
Wow, this is as much hand-holding as one can expect, and for a R newbie it is unbelievable and invaluable! Thanks again for all this help Marc! Here is the screen print of my entire R session: > .Machine$sizeof.pointer [1] 8 > > library(RODBC) > conn <- odbcConnect(dsn='qdblocal', uid = "ciqxf

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Eric Ma
Thanks Marc for the quick reply. I confirmed the R binary I built is indeed 64-bit. sqlplus works fine, so is the odbcConnect() call. Any idea the error is thrown by RODBC or R? Eric -- View this message in context: http://n4.nabble.com/Run-time-error-when-executing-sqlQuery-using-the-64-b

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-19 Thread Eric Ma
I am having the exact same error, and the suggested work-around does not help. My env is: 64-bit SUSE Linux v 10.1 on Xeon processors. gcc and gfortran version is 4.1.2 64-bit R 2.10.1 compiled from soure using CC="gcc -m64" etc. 64-bit unixODBC driver manager 2.2.14 compiled from source Orac

[R] How to draw a big heatmap?

2009-12-04 Thread Ning Ma
Hi everyone. How can I draw a big heatmaps? png("foo.png",1,1) heatmap(x) dev.off() where x is a big matrix, say 200*200. The code above generates a small heatmap in the middle of the png file and leaves big margins. I expect it to take up more space so that the labels are not overlappin

[R] Sample size calculation for paired proportion testing?

2009-11-21 Thread xiaojun ma
I would appreciate any help on this problem. I need to perform a sample size analysis for a study comparing the performances of 2 different methods of diagnostic classification. Assume that method 1 has an accuracy of p1 against known truths (a reference classification, as multiple categories), an

[R] turn off function output

2009-11-04 Thread Ning Ma
Hi, everybody Is there any way to turn off the output message of a function, maybe a result of cat() or print() command in that function. I only expected it to be executed quite and return a value. Any intermediate messages can be omitted. Thanks! Ma

[R] How to execute a funcition which name is stored in a string?

2009-11-01 Thread Ning Ma
Hi, everybody Is there any way to execute a function, which name is stored in a string. such as: a <- "ls()" foo(a) ## same as ls() itself. Or, to execute a R command, which is stored in a string such as: a <- "m1 <- matrix(1:9,3,3)" foo(a) ## same as the assignment itself __

[R] how to control the white space between sub figures

2009-10-24 Thread Ning Ma
Hi everybody, I use par(mfrow=c(2,2)) to draw 4 sub figures. The default white space between columns is a litte large. Is there any parameters to control it? Thanks in advance! Ma __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] text on a plot

2009-10-06 Thread Ning Ma
Hi, How can I put text in a figure which is not parallel to the axes,such as along the line x=2y. It seems that the function 'text' does not have such parameters. thanks in advance Ma __ R-help@r-project.org mailing list https://stat.ethz.

[R] Please Help me!

2009-10-02 Thread Tammy Ma
Hi, R-users, I have a problem: Because there are few files which can't be readed into R completely, so on the following subsequence programme, I use write.table, which creates the "NA" files for those incomplete files autimatically. I don't want those NA files. My programes formats looks like:

Re: [R] The problem of readLines

2009-10-01 Thread Tammy Ma
pushed back, silently. For all other connections the line will be > accepted, with a warning. " > > You can disable the warning with; > > readLines('your_file', warn = FALSE) > > On Thu, Oct 1, 2009 at 9:39 AM, Tammy Ma wrote: > > > > Dear R-users, >

Re: [R] Debug

2009-10-01 Thread Tammy Ma
From: metal_lical...@live.com To: r-help@r-project.org Subject: Debug Date: Thu, 1 Oct 2009 15:21:42 +0300 Hi, R-Users,' I have written a programe to process the bunch of files in one folder. But there is a error came out; How can I know which file returns error when being processed? I

[R] The problem of readLines

2009-10-01 Thread Tammy Ma
Dear R-users, I use "readLines" to read data, but when processing the large data set, there are few files which can not be readed in: 48: In readLines(name_c[i]) ... : incomplete final line found on 'C:/Documents and Settings/lma/My Documents/habitdata/244052900243997/calllog/calllog_log-20

Re: [R] Change directory to implement same programes

2009-09-30 Thread Tammy Ma
How do I source a bunch of files in different directories in R? > From: metal_lical...@live.com > To: r-help@r-project.org > Date: Wed, 30 Sep 2009 13:45:34 +0300 > Subject: [R] Change directory to implement same programes > > > HI, R-Users, > > I have one problem: > > I have written the the

[R] Change directory to implement same programes

2009-09-30 Thread Tammy Ma
HI, R-Users, I have one problem: I have written the the programs which process all file in one directory: for example: setwd("C:/Documents and Settings/lma/My Documents/Vappu-saved/Log") as the start. .. But I have many folders like "Vappu-saved" and there are a lot of files in each

[R] How to parsing data like this in R

2009-09-29 Thread Tammy Ma
Hi, R-users, I met a problem: Items:[Anna 'moi =) akku loppu joskus 4ltä. Kestää kauan nää..'\tAmer, Tuusula (0:20)\t20\t12\t16\t00\t00\t11]/Anne 'Ei jakoa,uus päivä muistio et 4n niin peruin. Hups'\t (0:16)\t0\t12\t18\t00\t00\t11/Elina 'Konsertissa. En tod. vastaa teille'\tEtu-Töölö, Helsink

Re: [R] How to combine matrices?

2009-09-22 Thread Zhiliang Ma
rbind(a, b, c) another function you might be interested in is cbind. cheers, On Tue, Sep 22, 2009 at 9:40 AM, FMH wrote: > Dear All, > > Let a, b and c are three matrices with same no. of column but different no. > of row. > > a <- matrix(1, 1, 2) > b <- matrix(2, 2, 2) > c <- matrix(3, 3, 2)

[R] Manipulate directory-help

2009-09-22 Thread Tammy Ma
Dear R-users, I have a problem: I have many files in the directory:"C:/Documents and Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneurs/Juha" I want to copy those files into the new directory: "C:/Documents and Settings/lma/My Documents/Juha/book" (<-use "paste"), I first create the dir

[R] Create directory and copy files in R

2009-09-21 Thread Tammy Ma
HI, All R users, My problem is: > fn [1] "C:/Documents and Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneurs/Juha/book_log-20041210T095019.txt" > dpath [1] "C:/Documents and Settings/lma/My Documents/Juha/book" I want to make a function "cyfun" to copy all files in "dir" to "deskdir"

[R] power analysis for 2-way anova

2009-09-04 Thread Tammy Ma
Dear R-help list, Does anyone have a function that I could use to determine power for 2 way Anova?? an A x B repeated measures study,power is 0.95, I'd like to draw separate lines for three different combinations of A and B: (2,2), (2,5), (2,8). Thanks a lot. Tammy _

[R] data frame

2009-09-01 Thread Tammy Ma
HI, R user, I generate the vectors with the same length. I want to put each vector into each column of data frame. Why it doesnt work`? rm<-data.frame() for(a in 1:6){ rm[,a]<-getmeasure(p1,a,speech) } thanks a lot Tammy _

Re: [R] Best R text editors?

2009-08-29 Thread Zhiliang Ma
Emacs + ESS On Thu, Aug 27, 2009 at 12:43 PM, Jonathan Greenberg wrote: > Quick informal poll: what is everyone's favorite text editor for working > with R?  I'd like to hear from people who are using editors that have some > level of direct R interface (e.g. Tinn-R, Komodo+SciViews).  Thanks! >

[R] how to generate a random correlation matrix with restrictions

2009-08-28 Thread Ning Ma
Hi, How can I generate a random 100x100 correlation matrix, R={r_ij}, where about 10% of r_ij are greater than 0.9 Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide htt

[R] how to index a list with a string?

2009-08-26 Thread Ning Ma
Hi, everybody. I have a list obj L, sth like $`aaa` [1] "5753" if the string 'aaa' is a returned value of a function foo(). what is the right syntax form of L$foo() I'm new to R, thanks in advance. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] Generate random sample interval

2009-08-24 Thread Tammy Ma
I need a simple algorithm to generate random ranges. > From: metal_lical...@live.com > To: r-help@r-project.org > Date: Mon, 24 Aug 2009 09:55:35 +0300 > Subject: [R] Generate random sample interval > > > Hi, R users, > > I have a problem about how to generate random sample interval from a d

[R] Generate random sample interval

2009-08-23 Thread Tammy Ma
Hi, R users, I have a problem about how to generate random sample interval from a duration. For example, during a time duration 0-70s, I want to generate a sample which last 10s. the sample could be 0-10 or 30-40s or 25-35s etc How could I do it in R`?? Thanks a lot. Tammy __

Re: [R] Simulation Function - Save results

2009-08-14 Thread Zhiliang Ma
in order to return more multiple variables, you can put them in a list and then return this list. e.g. #Function A boot<-function(a,b,c){ mean_boot<-(a+b)/2 var_boot<-c list(mean_boot = mean_boot, var_boot = var_boot) } out <- boot(1,2,3) out $mean_boot [1] 1.5 $var_boot [1] 3 On Fri, Aug 1

[R] help on Rmpi

2009-08-11 Thread Zhiliang Ma
Dear R Users, I'm using Rmpi package for paralleling computing. It's very useful. But I have two question: 1. before running processes on slaves, all the data should be sent to them. however, if i forget to broadcast some of the data, the master will freeze, and I have to kill the process manuall

Re: [R] overlap two graph

2009-08-10 Thread Zhiliang Ma
plot(allPoints, col=c(rep(2,201), rep(3,201))) On Mon, Aug 10, 2009 at 9:54 PM, Hemavathi Ramulu wrote: > Hi everyone, > I'm stuck again, need you all help. > > I managed to  plot the diagram using > > allPoints<-rbind(ellipsePoints(2,5, alpha = 30),ellipsePoints(2,5, alpha = > 60)) > plot(allPoin

Re: [R] Saving plots to file

2009-08-10 Thread Zhiliang Ma
?postscript ?pdf On Mon, Aug 10, 2009 at 9:25 AM, Sean MacEachern wrote: > Appologies if this has been addressed before, but I can't seem to find it in > the help archives. > > I'm looking to do something like the following but it looks like save.plot > is deprecated. > > save.plot(plot(glm1$resid

Re: [R] label X-Axis by abother variable in R plot

2009-08-09 Thread Zhiliang Ma
plot(b, c, xaxt="n") axis(1, at=b, labels=as.character(a)) On Sun, Aug 9, 2009 at 9:33 PM, Frank Zhang wrote: > > Hi, > > I would like to plot b, c in one plot, and use a as x-aix. How could I do > that? Thanks > > a,   b, c, > 20, 2, 3 > 21, 4, 5 > 22, 1, 2 > 24, 3, 5 > 50, 3, 6 > > > > > > > >

Re: [R] more than one mathematical annotation into a legend

2009-07-09 Thread Zhiliang Ma
On Thu, Jul 9, 2009 at 9:39 AM, Thomas Roth (geb. Kaliwe) wrote: try this: legend(4,4, expression(t[m] == x, t[n] == x)) cheers, Zhiliang > Dear members, > > Is there a way to put more than one mathematical annotation into a legend > together with a calculated value? > > x = 2 > plot(1:10) > > #

Re: [R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Zhiliang Ma
the following works. i don't exactly what happens here. I guess "lm" might treat S1 and S2 as quantitative variables, not qualitative variables. cheers, Zhiliang S1 <- as.character(Data[,1]) S1 <- as.factor(S1) S2 <- as.character(Data[,2]) S2 <- as.factor(S2) data <- data.frame(S1=S1, S2=S2, ExM=

Re: [R] Unix commands on R

2009-07-08 Thread Zhiliang Ma
?system On Wed, Jul 8, 2009 at 4:36 PM, suman Duvvuru wrote: > I am using R on unix. While in R how do I execute the unix shell commands? > Is there a way to do it? I am executing a function in R and the matrix > resulting from the function has to be passed on as an input to unix command. > > > An

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Zhiliang Ma
how about sum(!is.na(x)) ? On Tue, Jul 7, 2009 at 2:56 PM, Godmar Back wrote: > Hi, > > is there a simpler way to count the number of elements in a vector > that are not NA than this: > > countN <- function (v) { >    return (Reduce(function (x, y) x + y, ifelse(is.na(v), 0, 1))) > } > > ? > >  -

[R] poly regression

2009-06-09 Thread Ning Ma
hi, I want to do a polynomial regression of y on x of degree 2, as following > x<-1:10 > y<-x^2 > lm(y~poly(x,2)) Call: lm(formula = y ~ poly(x, 2)) Coefficients: (Intercept) poly(x, 2)1 poly(x, 2)2 38.5099.9122.98 Which is not what i had expected. If I wrote the expre

Re: [R] evaluate a expression

2009-05-02 Thread Ning Ma
Thank you and Sunder! On Sat, May 2, 2009 at 8:49 PM, ronggui wrote: >> eval(parse(text=expr)) > [1] 15 > > > 2009/5/2 Ning Ma : >> Hi, >> >> I am new to R. Can anyone tell me how to evaluate an expression stored >> in a string? >> such as:

[R] evaluate a expression

2009-05-02 Thread Ning Ma
Hi, I am new to R. Can anyone tell me how to evaluate an expression stored in a string? such as: > expr <- "3*5" I want to get the result 15. Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] About Matrix

2009-04-28 Thread Tammy Ma
Hi, Dear R users, I have a question: I have A matrix which is 11519X14 and B matrix which is 1764X14, How do I get C matrix which is The remaining matrix after removing B from A? Thanks a lot. Kind regards, Tammy _ More than m

[R] Matrix manipulation

2009-04-28 Thread Tammy Ma
From: metal_lical...@live.com To: r-help@r-project.org Subject: About Matrix Date: Tue, 28 Apr 2009 11:28:43 +0300 Hi, Dear R users, I have a question: I have A matrix which is 11519X14 and B matrix which is 1764X14, How do I get C matrix which is The remaining matrix after removing

[R] paste to collapse vector to string

2009-04-01 Thread Xiao-Jun Ma
Hi, I'm trying to collapse a character vector to strings, but I am getting unexpected behaviors in list context: A <- "a" B <- c("b","c") xx <- list(A=A, B=B) lapply(xx, paste, collaplse=".") $A [1] "a ." $B [1] "b ." "c ." paste(B, collapse=".") [1] "b.c" # this is what I

[R] About the proportion of data

2009-03-31 Thread Tammy Ma
Hi, All. I have scatterplot in 2-D I'd like to see which proportion of data goes into a range. How shall I figure it out? Perhaps some accumulative graph or something? Kind regards, Tammy _ Drag n’ drop—Get easy photo sharing wi

Re: [R] Merging

2009-03-17 Thread Tammy Ma
regate(V4, by=list(V1, V2, V3), sum)) > Group.1 Group.2 Group.3 x > 1 2006-02-22 16:31:14 useractivity_idle 0 0 > 2 2006-02-22 16:28:26 4 2 0 > 3 2006-02-22 16:28:28 3 3 0 > 4 2006-02-22 16:28:31

  1   2   >