similar to: create a vector

Displaying 20 results from an estimated 5000 matches similar to: "create a vector"

2006 May 16
2
split the data.frame
Dear R folks: I wonder anyone has a elegent way of doing what I need to do. I have a data frame called with four columns: V1, V2, A1 and A2: V1 V2 A1 A2 A B 1.2 2.0 A D 1.2 4.0 A C 2.4 2.2 What I need to do is to convert it into the following data frame with a new column x, where x is just the stacked up of A1 and A2 placed with respective V1 and V2 in the first two
2006 May 18
1
How to write output in a specific formate with irregular space
Dear R users: My question is how to write output in a specific formate with irregular spacing? Say that I have the following DF with three columns (A-C): A B C a10 100.0 212 The objective is to write an output file such that column A occupies 1-10 spaces aligned to the left, column B occupies 11-15 spaces aligned to the right, and finally column C takes 16-25 spaces
2006 Jul 11
1
problem of fixed-formated output using sprintf
Dear R users: I'm trying to generate a output file with fixed format using function "sprintf" in R. However, the execution time in R is very long even the toy data (smaller size df) seems to work fine. The syntax that I used is as follows: df.fmt <- sprintf("%2s%2s%2.4f", df$v1, df$v2, df$v3) write.table(df.fmt, output.name,...) The actual dataset is a df with the
2006 May 19
1
Writing to a file with fixed precision
Dear R users; A follow-up question regarding writing to a file with fixed precision: Assuming for each column of x, I would like to have a different format, then I modify the code as: x.fmt <- apply(x, 1, function(x) sprintf("%.14f %.10f %2.5f", x)) where three different formats are %.14f %.10f %2.5f. The error message I got is "Error in sprintf(fmt, ...) : too few
2006 Apr 27
2
add city and point in the map
Dear Helpers: I'm trying to use packages "maps" and "mapdata" (see blow) to display the research resutls on map (Mid-Atlantic region). In particular, I need to mark a number of points in the map by giving their latitude and longitude information. For instance, I would like to mark a point on (long, lat) =(75.56027, 39.09271). Also, I need to mark several cities that I
2004 Mar 10
3
How to use MLE-class?
Hi there, I had successfully use "MLE" function to solve my problem. Is there anyone knows how to get related information? i.e., value of likelihood function, information matrix, and etc. I know MLE-class can do it but I can not find any information tells me how to do it. Thanks a billions, Yihsu [[alternative HTML version deleted]]
2007 Dec 09
3
editor under MAC system
Dear R-user; I recently switched from PC to MAC. Is there a compatible editor as Win-editor with package RWinEdit for MAC? Thanks Yihsu Chen [[alternative HTML version deleted]]
2008 Dec 11
4
how to plot implicit functions
Dear R users -- I think this question was asked before but there was no reply to it. I would appreciate any suggestion any of you might have. I am interested in plotting several "implicit functions" (F(x,y,z)=0) on the same fig. Is there anyone who has an example code of how to do this? Thank you Yihsu
2007 Feb 22
2
write fixed format
Dear R users; Is there a function in R that I can put "text" with proper alignments in a fixed format. For instance, if I have three fields: A, B and C, where both A and C are text with 3 characters and left alignment; B is a numeric one with 2 decimals and 3 integer space digits. How can I put the following row in a file? (note there is a space between a and 2, and after b.)
2007 Jul 09
1
ca.jo
Dear R users; I'm using ca.jo for a VECM model. Is there a way that I can get sd/p-value to see whether coefficients estimated are statistical significant? Thank you Yours, Yihsu [[alternative HTML version deleted]]
2008 Feb 01
1
calculation fraction/ratio
Dear R users I wonder if there is a quick way to calculate the ratio/fraction of a list/data frame. For example, if I have a data frame with two fields: "Index" and "A". I would like to know the fractions of A's within the same "Index". That is, for Index =1, three fractions will be "1/(1+2+3)=0.17", "2/(1+2+3)=0.33", and
2011 Mar 30
3
optim and optimize are not finding the right parameter
Dear all, I have a function that predicts DV based on one predictor pred: pred<-c(0,3000000,7800000,15600000,23400000,131200000) DV<-c(0,500,1000,1400,1700,1900) ## I define Function 1 that computes the predicted value based on pred values and parameters a and b: calc_DV_pred <- function(a,b) { DV_pred <- rep(0,(length(pred))) for(i in 1:length(DV_pred)){ DV_pred[i] <- a *
2008 Jan 14
3
Adding menu items to a TaskBar
Hello I''m looking for a way to add menu items to a task bar icon menu. I have created a popup menu. And I want to add to a task bar icon menu items for example projects but it must be after user log in. 1. User log in 2. getting list of projects 3. adding menu items into task bar menu with project I attch a file with source code which I already written Thenks for reply''s
2006 May 16
0
solution of split data.frame
Dear Folks: My recent question concerning split data.frame has been solved using both following approaches. (Question is listed at the end.) solution 1: Try melt from the reshape package (by Gabor) library(reshape) melt(DF, 1:2) You may may need to resort it if the order is important. solution 2: good for large dataset (by Robert) "If your data set is really big, i.e. bigger than R
2005 Apr 30
8
Problem with Sangoma/Adtran 600 installation
I have installed Asterisk on a CentOS4 box and then installed Asterisk from CVS. I installed a Sangoma A101 and connected it to a Adtran 600 using a T1 Crossover cable. The 600 has 12 x FXS, 12 x FXO interfaces. I ran through the wanpipe install instructions and configured it, now I can run [root@altpbx asterisk]# wanrouter hwprobe ------------------------------- | Wanpipe Hardware Probe Info
2019 Oct 23
2
Confused setting up a "Virtual Server Hosting" config
Hi list, Can anyone advise me on the correct/best set up for Virtual Server Hosting? I have a guest in my server room wish to migrate to dedicated server I rented in an offsite in a data centre.  I rented a box with one NIC and one public IP.  I installed KVM on it and a guest. (both Ubuntu 18.04 LTS server edition).  I am struggling to get the networking right. Essentially I want the
2011 Jul 28
3
R
Good afternoon. I am a master student in University of Porto in Portugal. At this moment I’m starting to use R, so I have some doubts. The aim of my analysis is: calculate a pairwise FST matrix from fasta file and creat a principal component analyses with adegenet package (I use seqinr and ape package to read this file, then I convert this file into a genind object with DNA2genind function
2007 Jun 20
4
finding roots of multivariate equation
Hello, I want to find the roots of an equation in two variables. I am aware of the uniroot function, which can do this for a function with a single variable (as I understand it...) but cannot find a function that does this for an equation with more than one variable. I am looking for something implementing similar to a Newton-Raphson algorithm. Thanks. -- Bill Shipley North American Editor for
2008 Mar 31
14
To surf to URL mydomain.com instead of mydomain.com:3000?
My production server is using mongrel_rails on Ubuntu linux. With Firefox I can reach my production server with the URL: www.mydomain.com:3000/ but I can''t reach my production server with the URL www.mydomain.com/ Is there a way to configure mongrel so that I can reach my production server with the URL www.mydomain.com? -- Posted via http://www.ruby-forum.com/.
2009 Sep 20
4
running many different regressions
Dear R community, I have a dataframe with say 100 different variables. I wish to regress variable 1 separately on every other variable (2-100) in a linear regression using lm. There must be an easy way to do this without loops, but I have difficulties figuring this out... Can you please help? Thank you and best regards, Georg. ***************************************** Georg Ehret Johns Hopkins